Rosenbrock#

(hivenas.benchmarks.rosenbrock)

Rosenbrock optimization benchmark.

class Rosenbrock(dim)[source]#

Bases: NumericalBenchmark

The benchmark uses the scipy.optimize.rosen version 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 evaluate to satisfy the ObjectiveInterface hooks

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