ml-direct
Direct - DIviding RECTangles algorithm.
The algorithm is intended to minimize real valued multivariate scalar fields over a hyper-rectangular region of N, theoretically the only prerequisite to achieve convergence is that the function must be continuous in the domain or at least continuous over a neighborhood of the global minimum.
A tool for global optimization of real valued functions .
Installation
$ npm i ml-direct
Usage
import direct from 'ml-direct';
const options = {
iterations: 25,
};
const lowerBoundaries = [-5, 3];
const upperBoundaries = [4, -2];
const quadratic = function (x) {
let result = 0;
for (let i = 0; i < x.length; i++) {
result += Math.pow(x[i], 2);
}
return result;
};
const predicted = Direct(
quadratic,
lowerBoundaries,
upperBoundaries,
options,
);
// predicted.minFunctionValue = 0
// Array.from(predicted.optimum[0]) = [0, 0];