Class HpCategorical<T>

java.lang.Object
ai.djl.training.hyperparameter.param.Hyperparameter<T>
ai.djl.training.hyperparameter.param.HpCategorical<T>
Type Parameters:
T - the type of the options
Direct Known Subclasses:
HpBool

public class HpCategorical<T> extends Hyperparameter<T>
A Hyperparameter which is one of a fixed number of options (similar to an enum).
  • Constructor Details

    • HpCategorical

      public HpCategorical(String name, List<T> categories)
      Constructs a HpCategorical.
      Parameters:
      name - the name of the hyperparameters
      categories - the valid values for the hyperparameter
  • Method Details

    • random

      public T random()
      Returns a random value for the hyperparameter for a range of a fixed value if it is a HpVal.
      Specified by:
      random in class Hyperparameter<T>
      Returns:
      a random value for the hyperparameter for a range of a fixed value if it is a HpVal
    • toString

      public String toString()
      Overrides:
      toString in class Object