Skip to content

Instantly share code, notes, and snippets.

@chilang
chilang / README.md
Created December 5, 2024 09:13
MLX Flux Image Generator - Mac Installation Script (Final)

MLX Flux Image Generator Installation

A simple installer for the MLX Flux Image Generator, optimized for Apple Silicon Macs.

One-Line Installation

curl -fsSL https://gist.githubusercontent.com/chilang/02482073c949f4f8e3125364a1c93073/raw/install.sh | bash
@chilang
chilang / README.md
Created December 5, 2024 09:13
MLX Flux Image Generator - Mac Installation Script (Final)

MLX Flux Image Generator Installation

A simple installer for the MLX Flux Image Generator, optimized for Apple Silicon Macs.

One-Line Installation

curl -fsSL https://gist.githubusercontent.com/chilang/02482073c949f4f8e3125364a1c93073/raw/install.sh | bash
@chilang
chilang / README.md
Created December 5, 2024 09:13
MLX Flux Image Generator - Mac Installation Script

MLX Flux Image Generator Installation

A simple installer for the MLX Flux Image Generator, optimized for Apple Silicon Macs.

One-Line Installation

curl -fsSL https://gist.githubusercontent.com/chilang/02482073c949f4f8e3125364a1c93073/raw/install.sh | bash
@chilang
chilang / README.md
Created December 5, 2024 09:12
MLX Flux Image Generator Installation Script

MLX Flux Image Generator Installation

A simple installer for the MLX Flux Image Generator, optimized for Apple Silicon Macs.

One-Line Installation

curl -fsSL https://gist.githubusercontent.com/chilang/c9f6b7db9596282d5149a5611279da2f/raw/install.sh | bash
@chilang
chilang / README.md
Created December 5, 2024 09:11
MLX Flux Image Generator Installation Script

MLX Flux Image Generator Installation

A simple installer for the MLX Flux Image Generator, optimized for Apple Silicon Macs.

One-Line Installation

curl -fsSL https://gist.githubusercontent.com/chilang/058369df8ddf6ec11e94b49cd685b9cd/raw/install.sh | bash
@chilang
chilang / caption.js
Created November 16, 2023 15:54
hyperaudio-static
/*! (C) The Hyperaudio Project. MIT @license: en.wikipedia.org/wiki/MIT_License. */
/*! Version 2.1.4 */
'use strict';
var caption = function () {
var cap = {};
function formatSeconds(seconds) {
if (typeof seconds == 'number') {
//console.log("seconds = "+seconds);
ttest, pval = ttest_ind(local_mean_f1_scores, fed_avg_f1_scores)
print("statistically significant:", pval < 0.05)
print("p =", pval)
hyperparams = {
'n_runners': 10,
'sample_size': 5,
'rounds': 100,
'combine': 'weighted', # or 'mean'
'partition_params': {
'scheme': 'uniform' # stratified, non-iidness, noise injection etc.
},
'runner_hyperparams': {
'epochs': 1,
skews = {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.99}
scores = {}
for skew in skews:
print("eval", skew)
hyperparams = {
'n_runners': 10,
'sample_size': 10,
'rounds': 1,
'combine': 'weighted', # or 'mean'
'partition_params': {
def compare_f1(hyperparams, rounds=1):
local_mean_f1_scores = []
local_max_f1_scores = []
fed_avg_f1_scores = []
for i in range(0, rounds):
fed_avg = FedAvg(**hyperparams)
fed_avg.fit(X_train, y_train)
preds = fed_avg.predict(X_test)
fed_avg_f1_scores.append(f1_score(y_test, preds, average='weighted'))
tmp = []