nvflare.app_opt.p2p.utils.config_generator module

generate_random_network(num_clients: int, seed: int = 42, connection_probability: float = 0.3) Network[source]

Generate a random configuration for the given number of clients. The configuration includes the number of iterations, the network topology, and the initial values for each node.

Parameters:

num_clients (int) – The number of clients in the network.

Returns:

The generated configuration. np.ndarray: The weighted adjacency matrix of the network.

Return type:

BaseConfig