p2pfl.learning.frameworks.tensorflow.keras_learner moduleΒΆ

Keras learner for P2PFL.

class p2pfl.learning.frameworks.tensorflow.keras_learner.KerasLearner(model, data, self_addr='unknown-node', aggregator=None)[source]ΒΆ

Bases: Learner

Learner for TensorFlow/Keras models in P2PFL.

Parameters:
  • model (KerasModel) – The KerasModel instance.

  • data (P2PFLDataset) – The P2PFLDataset instance.

  • self_addr (str) – The address of this node.

evaluate()[source]ΒΆ

Evaluate the Keras model.

Return type:

Dict[str, float]

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 training process.

Return type:

None