p2pfl.learning.frameworks.simulation.virtual_learner moduleΒΆ

Virtual Node Learner.

class p2pfl.learning.frameworks.simulation.virtual_learner.VirtualNodeLearner(learner, addr)[source]ΒΆ

Bases: Learner

Decorator for the learner to be used in the simulation.

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_data()[source]ΒΆ

Get the data of the learner.

Return type:

P2PFLDataset

Returns:

The data of the learner.

get_framework()[source]ΒΆ

Return the framework of the wrapped learner.

Return type:

str

get_model()[source]ΒΆ

Get the model of the learner.

Return type:

P2PFLModel

Returns:

The model of the learner.

interrupt_fit()[source]ΒΆ

Interrupt the fit process.

Return type:

None

set_addr(addr)[source]ΒΆ

Set the address of the learner.

Parameters:

addr (str) – The address of the learner.

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 (Union[P2PFLModel, List[ndarray], bytes]) – The model of the learner.

Return type:

None