odatse.solver.analytical module
- class odatse.solver.analytical.Solver(info: Info)[source]
Bases:
Solver
Function Solver with pre-defined benchmark functions
Initialize the solver.
- Parameters:
info (Info) – Information object containing solver configuration.
- odatse.solver.analytical.ackley(xs: ndarray) float [source]
Ackley’s function in arbitrary dimension
- Parameters:
xs (np.ndarray) – Input array.
- Returns:
The calculated value of Ackley’s function.
- Return type:
float
Notes
It has one global minimum f(xs)=0 at xs=[0,0,…,0]. It has many local minima.
- odatse.solver.analytical.himmelblau(xs: ndarray) float [source]
Himmelblau’s function.
- Parameters:
xs (np.ndarray) – Input array of shape (2,).
- Returns:
The calculated value of Himmelblau’s function.
- Return type:
float
Notes
It has four global minima f(xs) = 0 at xs=[3,2], [-2.805118…, 3.131312…], [-3.779310…, -3.2831860], and [3.584428…, -1.848126…].
- odatse.solver.analytical.linear_regression_test(xs: ndarray) float [source]
Negative log likelihood of linear regression with Gaussian noise N(0,sigma)
y = ax + b
trained by xdata = [1, 2, 3, 4, 5, 6] and ydata = [1, 3, 2, 4, 3, 5].
Model parameters (a, b, sigma) are corresponding to xs as the following, a = xs[0], b = xs[1], log(sigma**2) = xs[2]
It has a global minimum f(xs) = 1.005071.. at xs = [0.628571…, 0.8, -0.664976…].
- Parameters:
xs (np.ndarray) – Input array of model parameters.
- Returns:
The negative log likelihood of the linear regression model.
- Return type:
float
- odatse.solver.analytical.quadratics(xs: ndarray) float [source]
Quadratic (sphere) function.
- Parameters:
xs (np.ndarray) – Input array.
- Returns:
The calculated value of the quadratic function.
- Return type:
float
Notes
It has one global minimum f(xs)=0 at xs = [0,0,…,0].
- odatse.solver.analytical.quartics(xs: ndarray) float [source]
Quartic function with two global minima.
- Parameters:
xs (np.ndarray) – Input array.
- Returns:
The calculated value of the quartic function.
- Return type:
float
Notes
It has two global minima f(xs)=0 at xs = [1,1,…,1] and [0,0,…,0]. It has one saddle point f(0,0,…,0) = 1.0.