Solve Function#
The solve function is the main entry point for solving optimization problems with PBALM.
Function Definition#
- pbalm.solution.solve(problem, x0, inner_solve_runner=None, lbda0=None, mu0=None, rho0=1e-3, nu0=1e-3, use_proximal=False, gamma0=1e-1, x_shapes=None, x_cumsizes=None, beta=0.5, alpha=10, delta=1.0, xi1=1.0, xi2=1.0, tol=1e-6, fp_tol=None, max_iter=1000, phase_I_tol=1e-7, start_feas=True, inner_solver=None, pa_direction=None, pa_solver_opts=None, verbosity=1, max_runtime=24.0, phi_strategy='pow', feas_reset_interval=None, no_reset=False, adaptive_fp_tol=False, max_iter_inner=1000)#
Solve the optimization problem using the Proximal Augmented Lagrangian Method (PBALM).
- Parameters:
problem (pbalm.Problem) – An instance of the
Problemclass defining the optimization problem.x0 (jax.numpy.ndarray) – Initial guess for the decision variables.
- Returns:
A
Resultobject containing the solution and solver information.- Return type:
pbalm.Result
Parameters#
Required Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
Problem |
The optimization problem to solve |
|
ndarray |
Initial guess for decision variables |
Lagrange Multiplier Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
ndarray or None |
Initial multipliers for equality constraints. If |
|
ndarray or None |
Initial multipliers for inequality constraints. If |
Penalty Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
float |
Initial penalty parameter for equality constraints. Default: |
|
float |
Initial penalty parameter for inequality constraints. Default: |
|
float |
Penalty growth exponent. Controls how quickly penalties increase. Default: |
|
float |
Constraint satisfaction threshold (0 < beta < 1). Penalties increase when
constraint violation doesn’t decrease by this factor. Default: |
|
float |
Penalty update scaling for equality constraints. Default: |
|
float |
Penalty update scaling for inequality constraints. Default: |
|
str |
Strategy for minimum penalty floor: |
Proximal ALM Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
bool |
Enable proximal ALM variant. Recommended for nonconvex problems. Default: |
|
float |
Initial proximal parameter. Default: |
|
float |
Proximal parameter update factor. Default: |
Convergence Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
float |
Convergence tolerance for KKT conditions. Default: |
|
int |
Maximum number of outer ALM iterations. Default: |
|
float |
Maximum runtime in hours. Default: |
Inner Solver Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
object or None |
Custom inner solver runner. If |
|
str or None |
Name of inner solver (only |
|
int |
Maximum iterations for inner solver. Default: |
|
float, callable, or None |
Fixed-point tolerance for inner solver. Can be a constant or function of iteration. |
|
bool |
Adaptively decrease inner solver tolerance. Default: |
|
object or None |
Direction method for PANOC (e.g., L-BFGS) |
|
dict or None |
Additional options for PANOC solver |
Feasibility Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
bool |
Solve Phase I to find feasible starting point. Default: |
|
float |
Tolerance for Phase I feasibility problem. Default: |
|
int or None |
Interval for resetting to a feasible point |
|
bool |
Disable feasibility resets. Default: |
Structured Variable Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
list or None |
Shapes of decision variable blocks for structured problems |
|
list or None |
Cumulative sizes of decision variable blocks |
Output Parameters:
Parameter |
Type |
Description |
|---|---|---|
|
int |
Output level. 0: silent, ≥1: show progress. Default: |
Example Usage#
Basic usage:
import jax.numpy as jnp
import pbalm
# Define problem
def f1(x):
return jnp.sum(x**2)
def h(x):
return jnp.sum(x) - 1.0
problem = pbalm.Problem(f1=f1, h=[h], jittable=True)
x0 = jnp.zeros(10)
# Solve with default settings
result = pbalm.solve(problem, x0)
With proximal ALM and custom parameters:
result = pbalm.solve(
problem,
x0,
use_proximal=True, # Enable proximal ALM
gamma0=0.1, # Initial proximal parameter
tol=1e-8, # Tighter tolerance
max_iter=500, # More iterations
alpha=5, # Slower penalty growth
verbosity=1 # Show progress
)
With adaptive inner solver tolerance:
# Custom tolerance schedule
def tol_schedule(k):
return 0.1 / (k + 1)**2
result = pbalm.solve(
problem,
x0,
fp_tol=tol_schedule,
adaptive_fp_tol=True
)
Silent mode:
result = pbalm.solve(problem, x0, verbosity=0)
Solver Output#
When verbosity=1, the solver prints a table showing progress:
iter | f | p. term | total infeas | rho | nu | gamma
------------------------------------------------------------------------------------------
0 | 1.0000e+00 | nan | 5.0000e-01 | 1.0000e-03 | 1.0000e-03 | 1.0000e-01
1 | 5.5000e-01 | 1.2345e-02 | 1.2000e-01 | 1.0000e-03 | 1.0000e-03 | 1.0000e-01
...
Columns:
iter: Outer iteration number
f: Objective function value
p. term: Proximal term value
total infeas: Total constraint infeasibility
rho: Maximum penalty parameter for equality constraints
nu: Maximum penalty parameter for inequality constraints
gamma: Proximal parameter