p2pfl.experiment moduleΒΆ

Experiment class.

class p2pfl.experiment.Experiment(exp_name, total_rounds)[source]ΒΆ

Bases: object

Class to represent an experiment.

exp_nameΒΆ

The name of the experiment.

Type:

str

total_roundsΒΆ

The total rounds of the experiment.

Type:

int

roundΒΆ

The current round.

Type:

int

Parameters:
  • exp_name (str) – The name of the experiment.

  • total_rounds (int) – The total rounds of the experiment.

increase_round()[source]ΒΆ

Increase the round number.

Raises:

ValueError – If the round is not initialized.

Return type:

None

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.