p2pfl.learning.frameworks.pytorch.lightning_learner moduleΒΆ

Lightning Learner for P2PFL.

class p2pfl.learning.frameworks.pytorch.lightning_learner.LightningLearner(model=None, data=None, aggregator=None)[source]ΒΆ

Bases: Learner

Learner with PyTorch Lightning.

Parameters:
  • model (P2PFLModel | None) – The model of the learner.

  • data (P2PFLDataset | None) – The data of the learner.

  • addr – The address of the learner.

  • aggregator (Aggregator | None)

evaluate()[source]ΒΆ

Evaluate the model with actual parameters.

Return type:

dict[str, float]

Returns:

The evaluation results.

fit()[source]ΒΆ

Fit the model.

Return type:

P2PFLModel

get_framework()[source]ΒΆ

Retrieve the learner name.

Return type:

str

Returns:

The name of the learner class.

interrupt_fit()[source]ΒΆ

Interrupt the fit.

Return type:

None

set_addr(addr)[source]ΒΆ

Set the addr of the node.

Parameters:

addr (str)

Return type:

str