def __init__(self, trans_var: AggregatorTransVar = None): if trans_var is None: trans_var = AggregatorTransVar() self._model_broadcaster = model_broadcaster.Server( trans_var=trans_var.model_broadcaster) self._model_scatter = model_scatter.Server( trans_var=trans_var.model_scatter)
def model_scatter_call(job_id, role, ind, *args): models = args[0] if role == consts.ARBITER: models = model_scatter.Server().get_models() return list(models) elif role == consts.HOST: model = models[ind + 1] return model_scatter.Client().send_model(model) else: model = models[0] return model_scatter.Client().send_model(model)
def __init__(self, trans_var=LegacyAggregatorTransVar()): self._guest_parties = trans_var.get_parties(roles=[consts.GUEST]) self._host_parties = trans_var.get_parties(roles=[consts.HOST]) self._client_parties = trans_var.client_parties self._loss_sync = loss_scatter.Server(trans_var.loss_scatter) self._converge_sync = has_converged.Server(trans_var.has_converged) self._model_scatter = model_scatter.Server(trans_var.model_scatter) self._model_broadcaster = model_broadcaster.Server( trans_var.model_broadcaster) self._random_padding_cipher = random_padding_cipher.Server( trans_var.random_padding_cipher)