Class Hyperparameter<T>

java.lang.Object
ai.djl.training.hyperparameter.param.Hyperparameter<T>
Type Parameters:
T - the type of the hyperparameter
Direct Known Subclasses:
HpCategorical, HpFloat, HpInt, HpSet, HpVal

public abstract class Hyperparameter<T> extends Object
A class representing an input to the network that can't be differentiated.

Some hyperparameters include learning rates, network sizes and shapes, activation choices, and model selection. In order to evaluate a set of hyperparameters, the only way is to fully train your model using those choices of hyperparameters. So, the full training loop involves training the model a number of times using different choices of hyperparameters. This can be mostly automated by using a HpOptimizer.

  • Field Details

    • name

      protected String name
  • Constructor Details

    • Hyperparameter

      public Hyperparameter(String name)
      Constructs a hyperparameter with the given name.
      Parameters:
      name - the name of the hyperparameter
  • Method Details

    • getName

      public String getName()
      Returns the name of the hyperparameter.
      Returns:
      the name of the hyperparameter
    • random

      public abstract T random()
      Returns a random value for the hyperparameter for a range of a fixed value if it is a HpVal.
      Returns:
      a random value for the hyperparameter for a range of a fixed value if it is a HpVal