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

Lightning Learner for P2PFL.

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

Bases: Learner

Learner with PyTorch Lightning.

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

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

  • self_addr (str) – The address of the learner.

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