shrinkage::RestrictedProximalPenalty
Shrinkage for Rust · rust · 0.3.0
Source: src/penalty/masked.rs
A convex penalty with an exact proximal map after excluding coordinates.
Each true entry in unpenalized excludes the corresponding coefficient. The restricted value equals the complete penalty evaluated with those coordinates set to zero. Its proximal map minimizes ||z - input||² / (2 * step) + self.value_restricted(z, unpenalized) and copies excluded inputs unchanged. Masks have one entry per coefficient.
A complete proximal map alone does not imply this capability. In particular, restoring excluded inputs after a coupled proximal map is generally wrong. External penalties must implement the restricted problem explicitly.
Methods
prox_restricted
Source: src/penalty/masked.rs
Write the exact restricted proximal minimizer into reusable storage.
Errors
Reject invalid parameters, nonpositive or nonfinite steps, mismatched input, output, or mask lengths, nonfinite input (including excluded coordinates), or nonfinite arithmetic. Output is unspecified on error.
validate_restricted_input
Source: src/penalty/masked.rs
Validate coefficients and a restriction without evaluating its value.
The default checks mask length and calls Penalty::validate_input on the complete coefficients. Override it if restriction changes input compatibility or if complete validation performs unused value arithmetic. This check must still reject invalid parameters and nonfinite excluded coefficients, including when an outer super::Scaled has zero scale.
Errors
Reject invalid parameters, coefficients, or mask lengths.
value_restricted
Source: src/penalty/masked.rs
Evaluate the penalty with excluded coordinates set to zero.
Errors
Reject invalid parameters, mismatched mask lengths, nonfinite coefficients (including excluded ones), or nonfinite arithmetic.
Implementation of RestrictedProximalPenalty
Source: src/penalty/masked.rs
Implementation of RestrictedProximalPenalty
Source: src/penalty/masked.rs
Implementation of RestrictedProximalPenalty
Source: src/penalty/masked.rs
Implementation of RestrictedProximalPenalty
Source: src/penalty/scaled.rs
