(Nonlinear) Optimization Functions#

The implementation for solver

\[\arg\min_{\theta \in R^s} f(\theta),\]

where

  • \(\theta\) is a \(s\)-dimensional parameter vector (note that \(s\) is the desired sparsity in sparsity-constraint optimization)

  • \(f(\theta)\) is the objective function.

Functions#

convex_solver_nlopt(objective_func, value_and_grad, ...)

A wrapper of nlopt solver for convex optimization.

skscope.numeric_solver.convex_solver_BFGS(objective_func, value_and_grad, init_params, optim_variable_set, data)[source]#
skscope.numeric_solver.convex_solver_nlopt(objective_func, value_and_grad, init_params, optim_variable_set, data)[source]#

A wrapper of nlopt solver for convex optimization.

Parameters:
  • objective_func (callable) – The objective function. objective_func(params, data) -> loss, where params is a 1-D array with shape (dimensionality,).

  • value_and_grad (callable) – The function to compute the loss and gradient. value_and_grad(params, data) -> (loss, grad), where params is a 1-D array with shape (dimensionality,).

  • init_params (array of shape (dimensionality,)) – The initial value of the parameters to be optimized.

  • optim_variable_set (array of int) – The index of variables to be optimized, others are fixed to the initial value.

  • data – The data passed to objective_func and value_and_grad.

Returns:

  • loss (float) – The loss of the optimized parameters, i.e., objective_func(params, data).

  • optimized_params (array of shape (dimensionality,)) – The optimized parameters.