Skip to content

Instantly share code, notes, and snippets.

@chilang
Created May 25, 2020 17:08
Show Gist options
  • Save chilang/825cd54acb7c169f1c503df2dd350e3f to your computer and use it in GitHub Desktop.
Save chilang/825cd54acb7c169f1c503df2dd350e3f to your computer and use it in GitHub Desktop.
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,
'lr': 0.15,
'batch_size': 0
}
}
fed_avg = FedAvg(**hyperparams)
fed_avg.fit(X_train, y_train)
preds = fed_avg.predict(X_test)
print(classification_report(y_test, preds, target_names=['class_0', 'class_1']))
print(fed_avg.intercept_)
print(fed_avg.coef_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment