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>
AHyperparameter
which is one of a fixed number of options (similar to an enum).
-
-
Field Summary
-
Fields inherited from class ai.djl.training.hyperparameter.param.Hyperparameter
name
-
-
Constructor Summary
Constructors Constructor Description HpCategorical(java.lang.String name, java.util.List<T> categories)
Constructs aHpCategorical
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
random()
Returns a random value for the hyperparameter for a range of a fixed value if it is aHpVal
.java.lang.String
toString()
-
Methods inherited from class ai.djl.training.hyperparameter.param.Hyperparameter
getName
-
-
-
-
Constructor Detail
-
HpCategorical
public HpCategorical(java.lang.String name, java.util.List<T> categories)
Constructs aHpCategorical
.- Parameters:
name
- the name of the hyperparameterscategories
- the valid values for the hyperparameter
-
-
Method Detail
-
random
public T random()
Returns a random value for the hyperparameter for a range of a fixed value if it is aHpVal
.- Specified by:
random
in classHyperparameter<T>
- Returns:
- a random value for the hyperparameter for a range of a fixed value if it is a
HpVal
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-