Interface HpOptimizer
-
- All Known Implementing Classes:
BaseHpOptimizer
,HpORandom
public interface HpOptimizer
An optimizer forHyperparameter
s.- See Also:
Hyperparameter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ai.djl.util.Pair<HpSet,java.lang.Float>
getBest()
Returns the best hyperparameters and loss.float
getLoss(HpSet config)
Returns the recorded loss.HpSet
nextConfig()
Returns the next hyperparameters to test.void
update(HpSet config, float loss)
Updates the optimizer with the results of a hyperparameter test.
-
-
-
Method Detail
-
nextConfig
HpSet nextConfig()
Returns the next hyperparameters to test.- Returns:
- the hyperparameters to test
-
update
void update(HpSet config, float loss)
Updates the optimizer with the results of a hyperparameter test.- Parameters:
config
- the tested hyperparametersloss
- the validation loss from training with those hyperparameters
-
getLoss
float getLoss(HpSet config)
Returns the recorded loss.- Parameters:
config
- the hyperparameters that were trained with- Returns:
- the loss
- Throws:
java.util.NoSuchElementException
- if the hyperparameters were not trained with before
-
getBest
ai.djl.util.Pair<HpSet,java.lang.Float> getBest()
Returns the best hyperparameters and loss.- Returns:
- the best hyperparameters and loss
-
-