Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ffe81754 authored by Rosalie Dauchez's avatar Rosalie Dauchez
Browse files

Adapt FederatedServer to use the new version of FLRunConfig

parent 39bd3b93
No related branches found
No related tags found
No related merge requests found
......@@ -205,9 +205,10 @@ class FederatedServer:
round_i = 0
while True:
round_i += 1
await self.training_round(round_i, config.training)
await self.evaluation_round(round_i, config.evaluate)
if not self._keep_training(round_i, config.rounds, early_stop):
await self.training_round(round_i, config.get_next_train_config)
if config.get_next_valid_config is not None:
await self.evaluation_round(round_i, config.get_next_valid_config)
if not self._keep_training(round_i, early_stop, config):
break
# Interrupt training when time comes.
self.logger.info("Stopping training.")
......@@ -387,10 +388,10 @@ class FederatedServer:
self.logger.info("Sending privacy requests to all clients.")
assert config.privacy is not None # else this method is not called
params = {
"rounds": config.rounds,
"batches": config.training.batch_cfg,
"n_epoch": config.training.n_epoch,
"n_steps": config.training.n_steps,
"rounds": config.n_rounds,
"batches": config.train_cfg.batch_cfg,
"n_epoch": config.train_cfg.n_epoch,
"n_steps": config.train_cfg.n_steps,
**dataclasses.asdict(config.privacy),
} # type: Dict[str, Any]
message = messaging.PrivacyRequest(**params)
......
quit 0 → 100644
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment