#[non_exhaustive]pub enum TrainingStrategy {
Local,
DataParallel {
num_replicas: usize,
aggregation: GradientAggregation,
},
ModelParallel {
partitions: Vec<Partition>,
communication: CommunicationProtocol,
},
Federated {
num_clients: usize,
rounds: usize,
aggregation: FederatedAggregation,
client_selection: ClientSelection,
},
PopulationBased {
population_size: usize,
generations: usize,
exploit: ExploitStrategy,
explore: ExploreStrategy,
},
Custom {
coordinator: String,
config: Value,
},
}Expand description
Training strategy — graph-level attribute, inherited by subgraphs.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Local
All nodes execute locally (default).
DataParallel
Replicate the entire graph on N workers, each sees a data shard. Gradients are aggregated after each step.
Fields
aggregation: GradientAggregationHow the replicas’ gradients are combined after each step.
ModelParallel
Arbitrary model partitioning: each Partition maps a set of node IDs to a worker target. Any topology is supported.
Fields
partitions: Vec<Partition>Which nodes run where. Nodes not covered by any
Partition stay on the default (local) target.
communication: CommunicationProtocolHow activations and gradients move between partitions.
Federated
Federated learning: data stays on workers, only model updates are shared. The coordinator aggregates after each round.
Fields
num_clients: usizeTotal number of participating clients (the pool
ClientSelection draws from each round).
aggregation: FederatedAggregationHow client updates are combined into the global model.
client_selection: ClientSelectionWhich clients participate in each round.
PopulationBased
Population-Based Training: evolutionary hyperparameter optimization. Each generation trains a population, evaluates, then evolves.
Fields
exploit: ExploitStrategyHow underperformers copy from top performers.
explore: ExploreStrategyHow copied hyperparameters are mutated afterwards.
Custom
User-defined strategy with a registered coordinator.
Trait Implementations§
Source§impl Clone for TrainingStrategy
impl Clone for TrainingStrategy
Source§fn clone(&self) -> TrainingStrategy
fn clone(&self) -> TrainingStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more