Proximal Operators¶
Reference for proximal operators and function implementations in POGS.
Overview¶
POGS uses proximal operators to handle the objective functions \(f\) and \(g\). Each function type has an associated proximal operator that is computed efficiently using closed-form solutions.
The proximal operator of a function \(h\) with parameter \(\rho\) is:
Supported Functions¶
Zero¶
Proximal operator: $$ \text{prox}(v) = v $$
Use case: Unconstrained variables
Identity¶
Proximal operator: $$ \text{prox}(v) = v - \frac{1}{\rho} $$
Use case: Linear objectives
Absolute Value¶
Proximal operator (soft thresholding): $$ \text{prox}(v) = \begin{cases} v - \frac{1}{\rho} & \text{if } v > \frac{1}{\rho} \ 0 & \text{if } |v| \leq \frac{1}{\rho} \ v + \frac{1}{\rho} & \text{if } v < -\frac{1}{\rho} \end{cases} $$
Use case: L1 regularization (Lasso)
Example:
Square¶
Proximal operator: $$ \text{prox}(v) = \frac{\rho}{\rho + 1} v $$
Use case: Least squares, L2 regularization
Example:
Indicator Functions¶
Indicator of¶
Proximal operator: $$ \text{prox}(v) = 0 $$
Use case: Equality constraints
Indicator of [0, ∞)¶
Proximal operator: $$ \text{prox}(v) = \max(0, v) $$
Use case: Non-negativity constraints
Indicator of (-∞, 0]¶
Proximal operator: $$ \text{prox}(v) = \min(0, v) $$
Use case: Non-positivity constraints
Indicator of [0, 1]¶
Proximal operator: $$ \text{prox}(v) = \max(0, \min(1, v)) $$
Use case: Box constraints
Huber Loss¶
Proximal operator: Computed via bisection or closed-form formula.
Use case: Robust regression (less sensitive to outliers than square loss)
Example:
Logistic Loss¶
Proximal operator: Computed numerically.
Use case: Logistic regression
Example:
Negative Logarithm¶
Proximal operator: $$ \text{prox}(v) = \frac{v + \sqrt{v^2 + 4/\rho}}{2} $$
Use case: Barrier functions, entropy maximization
Exponential¶
Proximal operator: Computed via Lambert W function.
Use case: Exponential objectives
Negative Entropy¶
Proximal operator: $$ \text{prox}(v) = \frac{1}{\rho} W(\rho v e^{\rho v}) $$
where \(W\) is the Lambert W function.
Use case: Entropy regularization
Max Functions¶
MaxPos0¶
Proximal operator: $$ \text{prox}(v) = \begin{cases} v - \frac{1}{\rho} & \text{if } v > \frac{1}{\rho} \ 0 & \text{otherwise} \end{cases} $$
Use case: ReLU activation, hinge loss
MaxNeg0¶
Proximal operator: $$ \text{prox}(v) = \begin{cases} v + \frac{1}{\rho} & \text{if } v < -\frac{1}{\rho} \ 0 & \text{otherwise} \end{cases} $$
Use case: Hinge loss (SVM)
Reciprocal¶
Proximal operator: Computed via cubic equation solution.
Use case: Reciprocal penalties
Function Parameterization¶
Each function can be parameterized using the FunctionObj struct:
template<typename T>
struct FunctionObj {
FunctionType type; // Base function h
T a = 1.0; // Input scaling
T b = 0.0; // Input shift
T c = 1.0; // Output scaling
T d = 0.0; // Linear term
T e = 0.0; // Constant offset
T rho = 1.0; // Penalty parameter
};
The full function is:
Examples¶
Weighted L1:
Shifted square:
Scaled indicator:
Implementation Details¶
Numerical Stability¶
POGS proximal operators are implemented with numerical stability in mind:
- Soft thresholding: Uses stable formula avoiding cancellation
- Log-exp: Uses log-sum-exp trick
- Square root: Checks for negative values
- Division: Handles near-zero denominators
Performance¶
- Most proximal operators have O(1) complexity
- Computed element-wise (embarrassingly parallel)
- GPU implementations available for dense problems
Adding Custom Functions¶
To add a new function:
- Add enum value to
FunctionType - Implement proximal operator in
prox_lib.h - Update function evaluation in
evaluator.h - Add tests
See Also¶
- Types - FunctionType enumeration
- Basic Usage - Using functions in practice
- Examples - Practical examples