Base#

(hivenas.benchmarks.base)

Abstract ObjectiveInterface class for numerical benchmarks.

class NumericalBenchmark(dim, minv, maxv, minimization)[source]#

Bases: ObjectiveInterface

Abstract class for Numerical Optimization Benchmarks

dim#

number of dimensions for the given benchmark

Type

int

maxv#

maximum value in the search space

Type

float

minv#

minimum value in the search space

Type

float

minimization#

determines whether this is a minimization or maximization problem

Type

bool

fully_train_best_model(from_arch: bool = True)[source]#

Exception handler for fully_train_best_model on NumericalBenchmarks

Raises

ValueError – raised when fully_train_best_model is called on a NumericalBenchmark

Parameters

from_arch (bool, optional) – N/A

get_neighbor(pos)[source]#

Finds a random neighbor by displacing 1 positional component by \(\phi\)

Parameters

pos (list) – list of positional components (floats)

Returns

a neighboring position

Return type

list

property is_minimize#

Minimization toggle getter

Returns

determines whether this is a minimization or maximization problem

Return type

bool

property maximum#

The maximum value getter

Returns

maximum value for a position component

Return type

float

property minimum#

The minimum value getter

Returns

minimum value for a position component

Return type

float

sample()[source]#

Samples a random point from the objective function

Returns

randomly sample a candidate from the given space

Return type

float