Class HyperparameterSearchSpace
Defines the search space for hyperparameter optimization.
public class HyperparameterSearchSpace
- Inheritance
-
HyperparameterSearchSpace
- Inherited Members
Remarks
For Beginners: A search space defines all possible values for each hyperparameter. For example, learning rate might be between 0.001 and 0.1, and batch size might be 16, 32, or 64.
Constructors
HyperparameterSearchSpace()
Initializes a new instance of the HyperparameterSearchSpace class.
public HyperparameterSearchSpace()
Properties
Parameters
Gets or sets the parameter distributions/ranges.
public Dictionary<string, ParameterDistribution> Parameters { get; set; }
Property Value
Methods
AddBoolean(string)
Adds a boolean parameter.
public void AddBoolean(string name)
Parameters
namestring
Exceptions
- ArgumentException
Thrown when name is null or empty.
AddCategorical(string, params object[])
Adds a categorical parameter (discrete choices).
public void AddCategorical(string name, params object[] choices)
Parameters
Remarks
For Beginners: Use this when you have specific choices like optimizer type ("adam", "sgd") or activation function ("relu", "tanh").
Exceptions
- ArgumentException
Thrown when choices is null or empty.
AddContinuous(string, double, double, bool)
Adds a continuous (real-valued) parameter.
public void AddContinuous(string name, double min, double max, bool logScale = false)
Parameters
Remarks
For Beginners: Use this for decimal numbers like learning rate (0.001) or dropout (0.5).
Exceptions
- ArgumentException
Thrown when min is greater than or equal to max, or when logScale is true and min is not positive.
AddInteger(string, int, int, int)
Adds an integer parameter.
public void AddInteger(string name, int min, int max, int step = 1)
Parameters
Remarks
For Beginners: Use this for whole numbers like batch size (32) or number of layers (5).
Exceptions
- ArgumentException
Thrown when min is greater than or equal to max, or when step is not positive.