openfl.callbacks.LambdaCallback#
- class openfl.callbacks.LambdaCallback(on_round_begin=None, on_round_end=None, on_experiment_begin=None, on_experiment_end=None)[source]#
Custom on-the-fly callbacks.
This callback can be constructed with functions that will be called at the appropriate time during the life-cycle of a Federated Learning experiment. Certain callbacks may expect positional arguments, for example:
on_round_begin: expects round_num as a positional argument.
on_round_end: expects round_num as a positional argument.
- Parameters:
on_round_begin – called at the beginning of every round.
on_round_end – called at the end of every round.
on_experiment_begin – called at the beginning of an experiment.
on_experiment_end – called at the end of an experiment.
- __init__(on_round_begin=None, on_round_end=None, on_experiment_begin=None, on_experiment_end=None)[source]#
Methods
__init__([on_round_begin, on_round_end, ...])on_experiment_begin([logs])Callback function to be executed at the beginning of an experiment.
on_experiment_end([logs])Callback function to be executed at the end of an experiment.
on_round_begin(round_num[, logs])Callback function to be executed at the beginning of a round.
on_round_end(round_num[, logs])Callback function to be executed at the end of a round.
set_params(params)set_tensor_db(tensor_db)