Skip to main content

UniformParameterRange

class automation.UniformParameterRange()#

Uniform randomly sampled 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 (float ) โ€“ The minimum sample to use for uniform random sampling.

    • max_value (float ) โ€“ The maximum sample to use for uniform random sampling.

    • step_size (float ) โ€“ If not None, set step size (quantization) for value sampling.

    • include_max_value (bool ) โ€“ Range includes the max_value

      The values are:

      * `True` - The range includes the `max_value` (Default)
      * `False` - Does not include.

UniformParameterRange.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 hyper-parameter strategy random number sampling.

  • Return type

    int

  • Returns

    The random seed.


get_value#

get_value()

Return uniformly sampled value based on object sampling definitions.

  • Return type

    Mapping[str, Any]

  • Returns

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


set_random_seed#

static set_random_seed(seed=1337)

Set global seed for all hyper-parameter 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. If self.step_size is not defined, return 100 points between min/max values.

  • Return type

    Sequence[Mapping[str, float]]

  • Returns

    list of dicts {name: float}