class yadll.hyperparameters.Hyperparameters[source]

Container class for the hyperparameters. Define each parameters with a name and a default value and optionally a list of values that will be iterated over during a grid search.

It create an iterable of all the different parameters values combination.


name : string, {‘batch_size’, ‘n_epochs’, ‘learning_rate’, ‘l1_reg’, ‘l2_reg’, ‘patience’}

The name of the hyperparameter.

value : float

The default value of the hyperparameter.

range : list of float

A list of values iterated over during the gris search


Define the hyperparameters of the model:

>>> hp = Hyperparameters()   # Create an Hyperparameters instance
>>> hp('batch_size', 500)    # Define an hyperparameter with its default value
>>> hp('n_epochs', 1000, [10, 100, 1000, 1000])    # and range for the grid search

Grid search on the hyperparameters space:

>>> for param in hp:
>>>     # Do something with this set of hyperparameters


reset reset all hyperparameters to default values.