p2pfl.experiment moduleΒΆ
Experiment class.
- class p2pfl.experiment.Experiment(exp_name, total_rounds, round=0, dataset_name=None, model_name=None, aggregator_name=None, framework_name=None, learning_rate=None, batch_size=None, epochs_per_round=None)[source]ΒΆ
Bases:
objectClass to represent an experiment.
- Parameters:
exp_name (
str) β The name of the experiment.total_rounds (
int) β The total rounds of the experiment.round (
int) β The current round.dataset_name (
str|None) β The name of the dataset.model_name (
str|None) β The name of the model.aggregator_name (
str|None) β The name of the aggregator.framework_name (
str|None) β The name of the framework.learning_rate (
float|None) β The learning rate.batch_size (
int|None) β The batch size.epochs_per_round (
int|None) β The number of epochs per round.
-
aggregator_name:
str|None= NoneΒΆ
-
batch_size:
int|None= NoneΒΆ
-
dataset_name:
str|None= NoneΒΆ
-
epochs_per_round:
int|None= NoneΒΆ
-
exp_name:
strΒΆ
-
framework_name:
str|None= NoneΒΆ
- increase_round()[source]ΒΆ
Increase the round number.
- Raises:
ValueError β If the round is not initialized.
- Return type:
None
-
learning_rate:
float|None= NoneΒΆ
-
model_name:
str|None= NoneΒΆ
-
round:
int= 0ΒΆ
- self(param_name, param_val=None)[source]ΒΆ
Getter and setter for the experiment parameters.
- Parameters:
param_name β The parameter name.
param_val β The parameter value.
- Returns:
The parameter value if param_val is None, or the parameter value if param_val is not None.
- to_dict(exclude_none=True)[source]ΒΆ
Convert the experiment to a dictionary.
- Parameters:
exclude_none (
bool) β If True, exclude fields with None values.- Return type:
dict- Returns:
Dictionary representation of the experiment.
-
total_rounds:
intΒΆ