p2pfl.learning.frameworks.simulation.virtual_learner moduleΒΆ
Virtual Node Learner.
- class p2pfl.learning.frameworks.simulation.virtual_learner.VirtualNodeLearner(learner)[source]ΒΆ
Bases:
Learner
Decorator for the learner to be used in the simulation.
- Parameters:
learner (
Learner
)
- add_callback_info_to_model()[source]ΒΆ
Add the additional information from the callbacks to the model.
- Return type:
None
- evaluate()[source]ΒΆ
Evaluate the model with actual parameters.
- Return type:
dict
[str
,float
]- Returns:
The evaluation results.
- indicate_aggregator(aggregator)[source]ΒΆ
Indicate to the learner the aggregators that are being used in order to instantiate the callbacks.
- Parameters:
aggregator (
Aggregator
) β The aggregator used in the learning process.- Return type:
None
- set_data(data)[source]ΒΆ
Set the data of the learner. It is used to fit the model.
- Parameters:
data (
P2PFLDataset
) β The data of the learner.- Return type:
None
- set_epochs(epochs)[source]ΒΆ
Set the number of epochs of the model.
- Parameters:
epochs (
int
) β The number of epochs of the model.- Return type:
None
- set_model(model)[source]ΒΆ
Set the model of the learner (not weights).
- Parameters:
model (
P2PFLModel
|list
[ndarray
] |bytes
) β The model of the learner.- Return type:
None