p2pfl.examples.mnist moduleΒΆ
Example of a P2PFL MNIST experiment, using a MLP model and a MnistFederatedDM.
- p2pfl.examples.mnist.mnist(n, r, e, show_metrics=True, measure_time=False, protocol='grpc', framework='pytorch', aggregator='fedavg', reduced_dataset=False, topology=TopologyType.LINE)[source]ΒΆ
P2PFL MNIST experiment.
- Parameters:
n (
int
) β The number of nodes.r (
int
) β The number of rounds.e (
int
) β The number of epochs.show_metrics (
bool
) β Show metrics.measure_time (
bool
) β Measure time.protocol (
str
) β The protocol to use.framework (
str
) β The framework to use.aggregator (
str
) β The aggregator to use.reduced_dataset (
bool
) β Use a reduced dataset just for testing.topology (
TopologyType
) β The network topology (star, full, line, ring).
- Return type:
None
- p2pfl.examples.mnist.set_standalone_settings(disable_ray=False)[source]ΒΆ
Set settings for testing. :rtype:
None
Important
HEARTBEAT_PERIOD: Too high values can cause late node discovery/fault detection. Too low values can cause high CPU usage.
GOSSIP_PERIOD: Too low values can cause high CPU usage.
TTL: Low TTLs can cause that some messages are not delivered.