BPt.p.Scalar#
- class BPt.p.Scalar(*args, **kwargs)[source]#
BPt parameter wrapper around
nevergrad.p.Scalar
.Attributes
Value of the positional arguments.
Estimate of the bounds (None if unbounded)
Stores the descriptor information for this parameter.
Dimension of the standardized space for this parameter i.e size of the vector returned by get_standardized_data(reference=...)
Generation of the parameter (children are current generation + 1)
Value of the keyword arguments.
Possibly multiobjective losses which were told to the optimizer along this parameter.
Name of the parameter This is used to keep track of how this Parameter is configured (included through internal/model parameters), mostly for reproducibility A default version is always provided, but can be overriden directly through the attribute, or through the set_name method (which allows chaining).
Random state the instrumentation and the optimizers pull from.
Value for the standard deviation used to mutate the parameter
integer
Methods
add_layer
(other)Adds a layer which will modify the object behavior
copy
()Creates a full copy of the parameter (with new unique uid).
freeze
()Prevents the parameter from changing value again (through value, mutate etc...)
get_standardized_data
(*, reference)Get the standardized data representing the value of the instance as an array in the optimization space.
Hashable object representing the current value of the instance
mutate
()Mutate parameters of the instance, and then its value
recombine
(*others)Update value and parameters of this instance by combining it with other instances.
register_cheap_constraint
(func[, as_layer])Registers a new constraint on the parameter values.
sample
()Sample a new instance of the parameter.
Whether the instance satisfies the constraints added through the register_cheap_constraint method
set_bounds
(*args, **kwargs)Bounds all real values into [lower, upper] using a provided method
Output will be cast to integer(s) through deterministic rounding.
set_mutation
(*args, **kwargs)Output will be cast to integer(s) through deterministic rounding.
set_name
(name)Sets a name and return the current instrumentation (for chaining)
set_recombination
(*args, **kwargs)Sets a recombination mutation.
set_standardized_data
(data, *[, reference])Updates the value of the provided reference (or self) using the standardized data.
spawn_child
([new_value])Creates a new instance which shares the same random generator than its parent, is sampled from the same data, and mutates independently from the parentp.
to_grid
()This method will attempt to convert from the current BPt / nevergrad style parameter to a sklearn-grid search compatible one.