mirror of https://github.com/davisking/dlib.git
Added a BOBYQA example.
--HG-- extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403216
This commit is contained in:
parent
1f93746e33
commit
59409fb50d
|
@ -5,7 +5,7 @@
|
|||
routines from the dlib C++ Library.
|
||||
|
||||
The library provides implementations of the conjugate gradient,
|
||||
BFGS and L-BFGS optimization algorithms. These algorithms allow
|
||||
BFGS, L-BFGS, and BOBYQA optimization algorithms. These algorithms allow
|
||||
you to find the minimum of a function of many input variables.
|
||||
This example walks though a few of the ways you might put these
|
||||
routines to use.
|
||||
|
@ -208,5 +208,24 @@ int main()
|
|||
test_function(target), starting_point, -1);
|
||||
cout << starting_point << endl;
|
||||
|
||||
|
||||
|
||||
// Finally, lets try the BOBYQA algorithm. This is a technique specially
|
||||
// designed to minimize a function in the absence of derivative information.
|
||||
// Generally speaking, it is the method of choice if derivatives are not available.
|
||||
|
||||
// For the details on what the parameters to this function represent see its documentation.
|
||||
starting_point = -4,5,99,3;
|
||||
find_min_bobyqa(test_function(target),
|
||||
starting_point,
|
||||
9, // number of interpolation points
|
||||
uniform_matrix<double>(4,1, -1e100), // lower bound constraint
|
||||
uniform_matrix<double>(4,1, 1e100), // upper bound constraint
|
||||
10, // initial trust region radius
|
||||
1e-6, // stopping trust region radius
|
||||
100 // max number of objective function evaluations
|
||||
);
|
||||
cout << starting_point << endl;
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue