Mentions légales du service

Skip to content

Add 'verbose' argument to 'FederatedClient' and 'TrainingManager'

ANDREY Paul requested to merge display-progress-bars into develop

This MR implements a QoL improvement on the client-side, by adding a verbose argument to FederatedClient, that:

  • triggers the display of progress bars during training and evaluation rounds when True.
  • automatically adjusts the default logger level when False.

This change translates in a verbose: bool=True argument to FederatedClient and to TrainingManager, plus an added dependency to the tqdm third-party package.

Notes:

  • At the moment, the progress bars mostly count iterations, without pre-computing the expected number of steps that will be taken - something which could be done, but should probably be designed together with some refactoring of the constraints system's use, and would be tricky in some situations (e.g. with procedural-generated data samples).
  • If end-users want to disable progress bars but set up their own fine-grained filters to the logger, they can, by setting up and passing a logging.Logger instance. In other words, only the default logger level is updated when verbose=False, but no action is taken on existing instances.

On the side, and as a mean to enable deploying verbose in a readable fashion to our examples and quickrun mode, the declearn.utils.run_as_processes function was modularized into accepting various types of inputs that specify the routines to be run. Previously, the format was (func, args) whereas it can now be any of (func, args), (func, kwargs) or (func, args, kwargs). Unit tests were also added for this util, covering both new and previously-existing features.

Edited by ANDREY Paul

Merge request reports

Loading