Skip to main content

ParameterSet

class automation.ParameterSet()

Discrete randomly sampled Hyper-Parameter object.

Uniformly sample values form a list of discrete options (combinations) of parameters.

  • Parameters

    parameter_combinations (list ) – The list/tuple of valid parameter combinations.

    For example, two combinations with three specific parameters per combination:

    [ {"opt1": 10, "arg2": 20, "arg2": 30},
    {"opt2": 11, "arg2": 22, "arg2": 33} ]

    Two complex combination each one sampled from a different range:

    [ {"opt1": UniformParameterRange('arg1',0,1) , "arg2": 20},
    {"opt2": UniformParameterRange('arg1',11,12), "arg2": 22},]

ParameterSet.from_dict

classmethod from_dict(a_dict)

Construct Parameter object from a dict representation (deserialize from dict).

  • Return type

    Parameter

  • Returns

    The Parameter object.

  • Parameters

    a_dict (Mapping [ str , str ] ) –


get_random_seed

static get_random_seed()

Get the global seed for all hyperparameter strategy random number sampling.

  • Return type

    int

  • Returns

    The random seed.


get_value

get_value()

Return uniformly sampled value from the valid list of values.

  • Return type

    Mapping[str, Any]

  • Returns

    {self.name: random entry from self.value}


set_random_seed

static set_random_seed(seed=1337)

Set global seed for all hyperparameter strategy random number sampling.

  • Parameters

    seed (int ) – The random seed.

  • Return type

    ()


to_dict

to_dict()

Return a dict representation of the Parameter object. Used for serialization of the Parameter object.

  • Return type

    Mapping[str, Union[str, Parameter]]

  • Returns

    dict representation of the object (serialization).


to_list

to_list()

Return a list of all the valid values of the Parameter.

  • Return type

    Sequence[Mapping[str, Any]]

  • Returns

    list of dicts {name: value}