PopulationBasedTrainingOptimizer<T, TInput, TOutput>
Models & Types · AiDotNet.HyperparameterOptimization
Implements Population-based Training (PBT) for hyperparameter optimization.
Inheritance: HyperparameterOptimizerBase<T, TInput, TOutput> → PopulationBasedTrainingOptimizer<T, TInput, TOutput>
How It Works
For Beginners: Population-based Training is an evolutionary approach that:
- Trains a population of models simultaneously
- Periodically checks each model’s performance
- Poor performers “exploit” better performers (copy their weights/hyperparameters)
- Copies are then “explored” (slightly mutated hyperparameters)
- This creates an online hyperparameter schedule adapted during training
Key concepts:
- Population: Multiple models training in parallel
- Exploit: Copy weights and hyperparameters from a better performer
- Explore: Perturb hyperparameters to discover better values
- Ready: A model is “ready” to exploit/explore after training for some steps
PBT can discover hyperparameter schedules that vary during training, something that grid/random/Bayesian search cannot do.
Constructors
| Constructor | Summary |
|---|---|
PopulationBasedTrainingOptimizer(bool maximize, int populationSize, int readyInterval, double exploitFraction, double perturbFactor, ExploitStrategy exploitStrategy, ExploreStrategy exploreStrategy, int? seed) |
Initializes a new instance of the PopulationBasedTrainingOptimizer class. |
Methods
| Method | Summary |
|---|---|
Dictionary<string, object> SuggestNext(HyperparameterTrial<T> trial) |
Suggests the next hyperparameter configuration to try. |
HyperparameterOptimizationResult<T> Optimize(Func<Dictionary<string, object>, T> objectiveFunction, HyperparameterSearchSpace searchSpace, int nTrials) |
Runs Population-based Training optimization. |
List<PopulationMemberInfo> GetPopulationState() |
Gets the current population state. |
PopulationMemberInfo GetBestMember() |
Gets the best member of the population. |