Interface HpOptimizer

All Known Implementing Classes:
BaseHpOptimizer, HpORandom

public interface HpOptimizer
An optimizer for Hyperparameters.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    ai.djl.util.Pair<HpSet,Float>
    Returns the best hyperparameters and loss.
    float
    getLoss(HpSet config)
    Returns the recorded loss.
    Returns the next hyperparameters to test.
    void
    update(HpSet config, float loss)
    Updates the optimizer with the results of a hyperparameter test.
  • Method Details

    • 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 hyperparameters
      loss - 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:
      NoSuchElementException - if the hyperparameters were not trained with before
    • getBest

      ai.djl.util.Pair<HpSet,Float> getBest()
      Returns the best hyperparameters and loss.
      Returns:
      the best hyperparameters and loss