Skip to content

Instantly share code, notes, and snippets.

@phil8192
Created April 3, 2020 20:28
Show Gist options
  • Save phil8192/774d9ef28f10b57cc73f8d6e5974a916 to your computer and use it in GitHub Desktop.
Save phil8192/774d9ef28f10b57cc73f8d6e5974a916 to your computer and use it in GitHub Desktop.
class Runner:
def __init__(self, X, y):
self.X = X
self.y = y
# called by FedAvg algo.
def optimise(self, intercept_init, coef_init, hyperparameters):
_intercept_init = intercept_init.copy()
_coef_init = coef_init.copy()
model = train_model(_intercept_init, _coef_init, self.X, self.y, **hyperparameters)
return model
def dataset_size(self):
return self.X.shape[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment