RealStarDiscrepancy¶
- class ioh.iohcpp.problem.RealStarDiscrepancy(self, instance: int = 1, n_variables: int = 5, n_samples: int = 5, sampler_type: ioh.iohcpp.problem.StarDiscrepancySampler = StarDiscrepancySampler.UNIFORM)¶
Bases:
RealSingleObjectiveStar-discrepancy problems
The 𝐿_infinity star discrepancy is a measure for the regularity of a finite set of points taken from [0, 1)^d. Calculating this measure is challenging, and exact algorithm fall short even for relatively small grids. This suite provides access to a set of these problems to tackle the problem from an optimization perspective.
There are two equivalent representations for these problems: Integer-based and Real-valued.
For the Real-valued, the goal is to find the a point in [0,1)^d which minimizes the resulting discepancy directly.
The Integer-valued version takes advantage of the fact that for each dimension, the optimium has a value matching an existing point int the grid. As such, the search for a point in the grid can be reduced to finding in each dimension the index of the coordinate, resulting in a search domain [0,n]^d, where n is the number of gridpoints.
Reference¶
[Clement23] Clement, Francois, Diederick Vermetten, Jacob de Nobel, Alexandre Jesus, Luís Paquete, and Carola Doerr. “Computing Star Discrepancies with Numerical Black-Box Optimization Algorithms.”
Star Discrepancy Problems
- param instance:
The instance of the problem, will be used as seed for sampler
- type instance:
int = 1
- param n_variables:
The dimension of the problem
- type n_variables:
int = 5
- param n_samples:
The number of sampled points
- type n_samples:
int = 5
- param sampler_type:
The type of sampler to use when sampling the points
- type sampler_type:
StarDiscrepancySampler
Attributes Summary
The bounds of the problem.
The constraints of the problem.
The grid of the problem, as a new (n_samples, n_variables) numpy array (float64)
The data is that being sent to the logger.
The static meta-data of the problem containing, e.g., problem id, instance id, and problem's dimensionality
The optimum and its objective value for a problem instance
All registered problems
The current state of the optimization process containing, e.g., the current solution and the number of function evaluated consumed so far
Methods Summary
__call__([order, device, writable])Overloaded function.
add_constraint(self, arg, /)add a constraint
attach_logger(self, arg, /)Attach a logger to the problem to allow performance tracking.
detach_logger(self)Remove the specified logger from the problem.
enforce_bounds(self[, weight, how, exponent])Enforced the bounds (box-constraints) as constraint :param weight: :type weight: The weight for computing the penalty (can be infinity to have strict box-constraints) :param how: :type how: The enforcement strategy, should be one of the 'ioh.ConstraintEnforcement' options :param exponent: :type exponent: The exponent for scaling the contraint
invert(self)remove_constraint(self, arg, /)remove a constraint
reset(self)Reset all state variables of the problem.
set_final_target(self, new_target)update the final target
set_id(self, new_problem_id)update the problem id
set_instance(self, new_instance)update the problem instance
set_name(self, new_name)update the problem name
Attributes Documentation
- bounds¶
The bounds of the problem.
- constraints¶
The constraints of the problem.
- create = <nanobind.nb_func object>¶
- grid¶
The grid of the problem, as a new (n_samples, n_variables) numpy array (float64)
- log_info¶
The data is that being sent to the logger.
- meta_data¶
The static meta-data of the problem containing, e.g., problem id, instance id, and problem’s dimensionality
- optimum¶
The optimum and its objective value for a problem instance
- problems¶
All registered problems
- state¶
The current state of the optimization process containing, e.g., the current solution and the number of function evaluated consumed so far
Methods Documentation
- __call__(self, arg: ndarray[dtype=float64, shape=(*), order='C', device='cpu', writable=False], /) float¶
- __call__(self, arg: collections.abc.Sequence[float], /) float
- __call__(self, arg: ndarray[dtype=float64, shape=(*, *), order='C', device='cpu', writable=False], /) numpy.ndarray[dtype=float64, shape=(*)]
- __call__(self, arg: collections.abc.Sequence[collections.abc.Sequence[float]], /) numpy.ndarray[dtype=float64, shape=(*)]
Overloaded function.
__call__(self, arg: ndarray[dtype=float64, shape=(*), order='C', device='cpu', writable=False], /) -> float__call__(self, arg: collections.abc.Sequence[float], /) -> floatEvaluate the problem.
- x: list
the search point to evaluate. It must be a 1-dimensional array/list whose length matches search space’s dimensionality
- float
The evaluated search point
__call__(self, arg: ndarray[dtype=float64, shape=(*, *), order='C', device='cpu', writable=False], /) -> numpy.ndarray[dtype=float64, shape=(*)]__call__(self, arg: collections.abc.Sequence[collections.abc.Sequence[float]], /) -> numpy.ndarray[dtype=float64, shape=(*)]Evaluate the problem at several search points.
- x: list[list]
the search points to evaluate, one per row. It must be a 2-dimensional array/list whose rows’ length matches search space’s dimensionality
- numpy.ndarray
The objective values of the search points: a new float64 array with one value per row
- add_constraint(self, arg: ioh.iohcpp.AbstractRealConstraint, /) None¶
add a constraint
- attach_logger(self, arg: ioh.iohcpp.logger.Logger, /) None¶
Attach a logger to the problem to allow performance tracking.
- Parameters:
logger (Logger) – A logger-object from the IOHexperimenter logger module.
- detach_logger(self) None¶
Remove the specified logger from the problem.
- enforce_bounds(self, weight: float = 1.0, how: ioh.iohcpp.ConstraintEnforcement = ConstraintEnforcement.SOFT, exponent: float = 1.0) None¶
Enforced the bounds (box-constraints) as constraint :param weight: :type weight: The weight for computing the penalty (can be infinity to have strict box-constraints) :param how: :type how: The enforcement strategy, should be one of the ‘ioh.ConstraintEnforcement’ options :param exponent: :type exponent: The exponent for scaling the contraint
- invert(self) None¶
- remove_constraint(self, arg: ioh.iohcpp.AbstractRealConstraint, /) None¶
remove a constraint
- reset(self) None¶
Reset all state variables of the problem.
- set_final_target(self, new_target: float) None¶
update the final target
- set_id(self, new_problem_id: int) None¶
update the problem id
- set_instance(self, new_instance: int) None¶
update the problem instance
- set_name(self, new_name: str) None¶
update the problem name