nvflare.app_opt.p2p.types package¶
Module contents¶
- class Config(network: ~nvflare.app_opt.p2p.types.Network, extra: dict = <factory>)[source]¶
Bases:
objectRepresents the configuration for the peer-to-peer algorithm.
The configuration includes the network topology and any extra algorithm-specific parameters. Algorithm-specific parameters in extra can include settings like ‘stepsize’, ‘iterations’, etc.
- extra: dict¶
- class LocalConfig(neighbors: list[~nvflare.app_opt.p2p.types.Neighbor], extra: dict = <factory>)[source]¶
Bases:
objectRepresents the local configuration for a node in the network.
The local configuration includes the node’s neighbors and any extra algorithm-specific parameters. Algorithm-specific parameters in extra can include settings like ‘stepsize’, ‘iterations’, etc.
- extra: dict¶
- class Neighbor(id: int | str, weight: float | None = None)[source]¶
Bases:
objectRepresents a neighbor in the network.
Each neighbor is characterized by an identifier and an optional weight, which can be used in algorithms that require weighted interactions between nodes.
- id: int | str¶
- weight: float | None = None¶
- class Network(nodes: list[~nvflare.app_opt.p2p.types.Node] = <factory>)[source]¶
Bases:
objectRepresents a network consisting of multiple nodes.
The network defines the topology over which the peer-to-peer algorithm operates. During initialization, any node specified as a dictionary is converted into a Node instance.
- class Node(id: int | str | None = None, neighbors: list[~nvflare.app_opt.p2p.types.Neighbor] = <factory>)[source]¶
Bases:
objectRepresents a node in the network.
A node contains an identifier and a list of its neighbors. During initialization, any neighbor specified as a dictionary is converted into a Neighbor instance to ensure consistent data structures.
- id: int | str | None = None¶