Rosenbrock#
(hivenas.benchmarks.rosenbrock)
Rosenbrock optimization benchmark.
- class Rosenbrock(dim)[source]#
Bases:
NumericalBenchmarkThe benchmark uses the
scipy.optimize.rosenversion of Rosenbrock, as given by\[\sum_{i=1}^{\text{dim} - 1} (100(X_{i+1} - X_{i}^{2})^2 + (1 - X_{i - 1})^2\]- evaluate(pos)[source]#
Evaluate the given position
- Parameters
pos (list) – list of floats representing the position components
- Returns
fitness value of the given position along with the static data required by
ObjectiveInterface- Return type
dict
- momentum_eval(pos, weights, m_epochs)[source]#
Redundant implementation as
evaluateto satisfy theObjectiveInterfacehooks- Parameters
pos (list) – list of position components (floats)
weights (str) – N/A
m_epochs (int) – N/A
- Returns
a dictionary containing the evaluated fitness value
- Return type
dict