automation.parameters.UniformIntegerParameterRange

class trains.automation.parameters.UniformIntegerParameterRange

Uniform randomly sampled integer Hyper-Parameter object.

Create a parameter to be sampled by the SearchStrategy.

Parameters
  • name (str) – The parameter name. Match the task hyper-parameter name.

  • min_value (int) – The minimum sample to use for uniform random sampling.

  • max_value (int) – The maximum sample to use for uniform random sampling.

  • step_size (int) – The default step size is 1.

  • include_max_value (bool) –

    Range includes the max_value

    The values are:

    • True - Includes the max_value (Default)

    • False - Does not include.

classmethod from_dict(a_dict)

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

Returns

The Parameter object.

static get_random_seed()

Get the global seed for all hyper-parameter strategy random number sampling.

Returns

The random seed.

get_value()

Return uniformly sampled value based on object sampling definitions.

Returns

{self.name: random value [self.min_value, self.max_value)}

static set_random_seed(seed=1337)

Set global seed for all hyper-parameter strategy random number sampling.

Parameters

seed (int) – The random seed.

to_dict()

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

Returns

dict representation of the object (serialization).

to_list()

Return a list of all the valid values of the Parameter. If self.step_size is not defined, return 100 points between minmax values.

Returns

list of dicts {name: int}