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>
AHyperparameterwhich 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 Trandom()Returns a random value for the hyperparameter for a range of a fixed value if it is aHpVal.java.lang.StringtoString()-
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:
randomin 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:
toStringin classjava.lang.Object
-
-