Class BaseHpOptimizer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected HpSet hyperParams  
      protected java.util.Map<HpSet,​java.lang.Float> results  
    • Method Summary

      All Methods Instance Methods Concrete 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.
      void update​(HpSet config, float loss)
      Updates the optimizer with the results of a hyperparameter test.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • hyperParams

        protected HpSet hyperParams
      • results

        protected java.util.Map<HpSet,​java.lang.Float> results
    • Constructor Detail

      • BaseHpOptimizer

        public BaseHpOptimizer​(HpSet hyperParams)
        Constructs a BaseHpOptimizer.
        Parameters:
        hyperParams - the set of hyperparameters
    • Method Detail

      • update

        public void update​(HpSet config,
                           float loss)
        Updates the optimizer with the results of a hyperparameter test.
        Specified by:
        update in interface HpOptimizer
        Parameters:
        config - the tested hyperparameters
        loss - the validation loss from training with those hyperparameters
      • getLoss

        public float getLoss​(HpSet config)
        Returns the recorded loss.
        Specified by:
        getLoss in interface HpOptimizer
        Parameters:
        config - the hyperparameters that were trained with
        Returns:
        the loss
      • getBest

        public ai.djl.util.Pair<HpSet,​java.lang.Float> getBest()
        Returns the best hyperparameters and loss.
        Specified by:
        getBest in interface HpOptimizer
        Returns:
        the best hyperparameters and loss