p2pfl.stages.stage moduleΒΆ

Stage.

exception p2pfl.stages.stage.EarlyStopException[source]ΒΆ

Bases: Exception

Custom exception for early stopping.

class p2pfl.stages.stage.Stage[source]ΒΆ

Bases: object

Abstract class for a stage.

static execute()[source]ΒΆ

Execute the stage.

Return type:

Optional[Type[Stage]]

static name()[source]ΒΆ

Return the name of the stage.

Return type:

str

p2pfl.stages.stage.check_early_stop(state, raise_exception=True)[source]ΒΆ

Check if early stopping is required.

Parameters:
  • state (NodeState) – Node state

  • raise_exception (bool) – Whether to raise an exception for early stopping.

Returns:

True if early stopping is required, False otherwise.

Return type:

bool

Raises:

EarlyStopException – Early stopping