ASHAOptimizer<T, TInput, TOutput>
Models & Types · AiDotNet.HyperparameterOptimization
Implements ASHA (Asynchronous Successive Halving Algorithm) for hyperparameter optimization.
Inheritance: HyperparameterOptimizerBase<T, TInput, TOutput> → ASHAOptimizer<T, TInput, TOutput>
How It Works
For Beginners: ASHA is an improved version of Hyperband that:
- Doesn’t wait for all configurations at a level before promoting some
- Can promote promising configurations as soon as they outperform enough peers
- Is naturally suited for parallel/distributed training
- Typically converges faster than synchronous Hyperband
Key concepts:
- Rungs: Resource levels at which we evaluate (e.g., epochs 1, 3, 9, 27)
- Promotion: Moving a configuration to train with more resources
- Early Stopping: Killing configurations that aren’t competitive
ASHA uses the same exponential resource increase as Hyperband but allows asynchronous promotion based on relative performance.
Constructors
| Constructor | Summary |
|---|---|
ASHAOptimizer(bool maximize, int maxResource, int reductionFactor, int minResource, double promotionThreshold, int? seed) |
Initializes a new instance of the ASHAOptimizer class. |
Properties
| Property | Summary |
|---|---|
List<int> Rungs { get; } |
Gets the resource levels (rungs) in this ASHA configuration. |
Methods
| Method | Summary |
|---|---|
Dictionary<int, RungStatistics> GetRungStatistics() |
Gets statistics about configurations at each rung. |
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) |
Searches for the best hyperparameter configuration using ASHA. |
ValueTuple<Dictionary<string, object>, T> GetBestConfiguration() |
Gets the best configuration found at the highest rung. |