Uno
Uno (Unifying Nonlinear Optimization) is a C++ library for solving nonlinearly constrained optimization problems
Installation
Uno and its Python interface must be installed via the unopy package unopy.
Options
Uno decomposes nonlinear optimization algorithms into a set of “ingredients” that can be combined in various ways.
To mimic the behavior of well-known algorithms, it has several presets.
Further customization is available via other options.
For complete and up-to-date information about all options, please refer to the Uno options documentation.
Name |
Type |
Default value |
Description |
|---|---|---|---|
|
str |
|
Specifies the preset option in Uno (str).
The default value is |
|
TextIO or str or Path |
None |
The stream to which the logger writes the log. The default value is None, which leaves the logger stream unchanged. If given as a string or Path, open that file for the log. |
|
list |
[] |
This option is unique to the Python wrapper, and takes a list of values which can be saved at each major iteration to the History file. A “major iteration” corresponds to an accepted iterate in Uno’s outer loop (i.e. an iterate that passed the globalization strategy’s acceptance test). Trial points evaluated during line search or trust-region rejections are not major iterations. The following entries are always saved at every major iteration regardless of this option:
The possible values that can be added via this option are
The default value is |
|
float |
1e-08 |
Tolerance on constraint violation (double). The default value is |
|
float |
1e-08 |
Tolerance on stationarity and complementarity (double). The default value is |
|
float |
1e-06 |
Loose tolerance on constraint violation (double). The default value is |
|
float |
1e-06 |
Loose tolerance on stationarity and complementarity (double). The default value is |
|
int |
15 |
Number of iterations before loose tolerance applies (int). The default value is |
|
int |
2000 |
Maximum number of outer iterations (int). The default value is |
|
float |
inf |
Time limit in seconds (double). The default value is |
|
float |
-1e+20 |
Objective threshold for unboundedness detection (double). The default value is |
|
str |
|
The verbosity level of the output (str).
Increasing levels out output are provided in the sequence:
- The default value is |
|
bool |
False |
Output primal-dual solution (bool). The default value is |
|
bool |
False |
Output subproblem in DEBUG mode only (bool). The default value is |
|
str |
|
Norm for progress measures (str). Options: L1, L2, INF. The default value is |
|
str |
|
Norm for residuals (str). Options: L1, L2, INF. The default value is |
|
float |
100.0 |
Scaling factor for residuals (double). The default value is |
|
bool |
False |
Protection against roundoff errors (bool). The default value is |
|
float |
10.0 |
Machine epsilon coefficient (double). The default value is |
|
str |
|
One of The default in pyOptSParse is |
|
int |
20 |
Size of quasi-Newton limited memory (int). The default value in pyOptSParse is |
Informs
Code |
Description |
|---|---|
|
Success |
|
Iteration Limit Exceeded |
|
Time Limit Exceeded |
|
Evaluation Error |
|
Algorithmic Error |
|
User Termination |
API
- class pyoptsparse.pyUno.pyUno.Uno(*args, **kwargs)[source]
Uno Optimizer Class - Inherited from Optimizer Abstract Class.
Uses the
unopyPython bindings to the Uno unified nonlinear optimizer.Uno Optimizer Class Initialization.
- Parameters:
- raiseErrorbool
If True, raises an ImportError when unopy is not available.
- optionsdict
Dictionary of options to pass to the optimizer.
- __call__(optProb, sens=None, sensStep=None, sensMode=None, storeHistory=None, hotStart=None, storeSens=True)[source]
This is the main routine used to solve the optimization problem.
- Parameters:
- optProbOptimization or Solution class instance
This is the complete description of the optimization problem to be solved by the optimizer.
- sensstr or python Function.
Specify method to compute sensitivities. To explicitly use pyOptSparse gradient class to do the derivatives with finite differences use ‘FD’. ‘sens’ may also be ‘CS’ which will cause pyOptSparse to compute the derivatives using the complex step method. Finally, ‘sens’ may be a python function handle which is expected to compute the sensitivities directly. For expensive function evaluations and/or problems with large numbers of design variables this is the preferred method.
- sensStepfloat
Set the step size to use for design variables. Defaults to 1e-6 when sens is ‘FD’ and 1e-40j when sens is ‘CS’.
- sensModestr
Use ‘pgc’ for parallel gradient computations. Only available with mpi4py and each objective evaluation is otherwise serial.
- storeHistorystr
File name of the history file into which the history of this optimization will be stored.
- hotStartstr
File name of the history file to “replay” for the optimization. The optimization problem used to generate the history file specified in ‘hotStart’ must be IDENTICAL to the currently supplied ‘optProb’. By identical we mean, EVERY SINGLE PARAMETER MUST BE IDENTICAL. As soon as the requested evaluation point does not match the history, function and gradient evaluations revert back to normal evaluations.
- storeSensbool
Flag specifying if sensitivities are to be stored in hist. This is necessary for hot-starting only.