◆ FORGE Suite
GitHubMechanical Neuroimaging Lab · Univ. of Delaware
Skip to content

Regularization

Sentinel provides 10 regularization methods in three categories: penalty methods (added to the objective), Hessian modifiers (modify the update direction), and post-processing methods (applied after each iteration).

See the Mathematical Reference for complete functional definitions.

Abstract Interface

Sentinel.AbstractRegularization Type
julia
AbstractRegularization

Abstract supertype for all regularization methods.

source
Sentinel.WeightSchedule Type
julia
WeightSchedule

Linear interpolation of a regularization weight from start_weight to end_weight over iterations delay+1 through max_iter.

Before iteration delay, the weight is 0. After max_iter, it stays at end_weight.

Ports the weight ramp-up logic from the Fortran regularization modules.

source
Sentinel.evaluate_weight Function
julia
evaluate_weight(ws::WeightSchedule, iteration::Int) -> Float64

Evaluate the scheduled weight at the given iteration. Returns 0 for iterations ≤ delay, then linearly interpolates.

source

Penalty Methods

Tikhonov

R(θ)=12αθθref2

Sentinel.TikhonovReg Type
julia
TikhonovReg <: AbstractRegularization

Tikhonov (L2) regularization penalizing deviation from reference values.

Fields

  • prop_index::Int: which material property (1-based) this applies to

  • weight_real::WeightSchedule: weight schedule for real part

  • weight_imag::WeightSchedule: weight schedule for imaginary part

  • theta_ref_real::Vector{Float64}: (npr,) reference values for real part

  • theta_ref_imag::Vector{Float64}: (npi,) reference values for imaginary part

source

Total Variation

R(θ)=αegpwgp|J||θ|2+ε2

Sentinel.TotalVariationReg Type
julia
TotalVariationReg <: AbstractRegularization

Total Variation regularization with smooth (Huber-like) approximation.

Fields

  • prop_index::Int: which material property (1-based)

  • weight_real::WeightSchedule: weight schedule for real part

  • weight_imag::WeightSchedule: weight schedule for imaginary part

  • epsilon::Float64: smoothing parameter δ for √(|∇θ|² + ε²)

  • active::Bool: false on first iteration, true after update_weights!

  • mtrl_mesh::MaterialMesh: hex8 material mesh for integration

  • node_to_elements::Vector{Vector{Int}}: precomputed inverse connectivity

source

Soft Prior

Region-based Laplacian penalty: R(θ)=αj(Lθ)j2

Sentinel.SoftPriorReg Type
julia
SoftPriorReg <: AbstractRegularization

Soft prior regularization using region-based Laplacian penalty.

Fields

  • prop_index::Int: which material property (1-based)

  • weight_real::WeightSchedule: weight schedule for real part

  • weight_imag::WeightSchedule: weight schedule for imaginary part

  • region_info::RegionInfo: region assignment for material mesh nodes

source
Sentinel.RegionInfo Type
julia
RegionInfo

Region assignment information for nodes in a material mesh. Used by soft prior regularization to penalize deviation within regions.

Fields

  • node_region::Vector{Int}: (nn,) region ID per node (0 = no region)

  • nregions::Int: number of distinct regions

  • region_node_count::Vector{Int}: (nregions,) node count per region

  • region_node_lists::Vector{Vector{Int}}: (nregions,) node lists per region

source

Exterior Constraint

R(θ)=αk[max(0,θkθmax)2+max(0,θminθk)2]

Sentinel.ExteriorConstraintReg Type
julia
ExteriorConstraintReg <: AbstractRegularization

Exterior constraint penalty that enforces parameter bounds.

Penalty is zero when parameters are within bounds and grows quadratically with violation magnitude. The scalar s = prop.scalar[1] (real) or prop.scalar[2] (imaginary) converts from stored normalized values to physical units before checking bounds.

Fields

  • prop_index::Int: which material property (1-based)

  • weight::Float64: penalty weight

  • min_real::Float64: minimum allowed physical real value

  • max_real::Float64: maximum allowed physical real value

  • min_imag::Float64: minimum allowed physical imaginary value

  • max_imag::Float64: maximum allowed physical imaginary value

source

Hessian Modifiers

Joachimowicz

Scales the diagonal Hessian: HkkH¯ϵw

Sentinel.JoachimowiczReg Type
julia
JoachimowiczReg <: AbstractRegularization

Joachimowicz Hessian regularization.

Adds avg_diag · total_error · w to each diagonal entry of the Hessian for the specified property parameters.

Fields

  • prop_index::Int: which material property (1-based)

  • weight::WeightSchedule: weight schedule

source

Marquardt

Normalized Levenberg-Marquardt damping: normalize H, add λI, rescale solution.

Sentinel.MarquardtReg Type
julia
MarquardtReg <: AbstractRegularization

Levenberg-Marquardt Hessian regularization with adaptive weight.

Fields

  • prop_index::Int: which material property (1-based)

  • current_weight::Float64: current λ value

  • start_weight::Float64: initial λ value (for reset)

  • min_weight::Float64: minimum λ value (floor)

  • delta::Float64: reduction factor (< 1.0) applied on successful steps

  • adjust_threshold::Float64: |1−α| threshold for adaptation

source
Sentinel.normalize_and_regularize! Function
julia
normalize_and_regularize!(H, grad_vec, reg::MarquardtReg, grad::MaterialGradient,
                           material::Material) -> Vector{Float64}

Perform the Marquardt normalization and regularization in-place:

  1. Compute D_k = √|H[k,k]| for relevant parameters

  2. Normalize: H[i,j] /= D_i·D_j, grad[k] /= D_k

  3. Add λ to diagonal: H[k,k] += reg.current_weight

Returns the scaling vector D for post-solve rescaling.

source
Sentinel.rescale_solution! Function
julia
rescale_solution!(delta_theta, D, reg::MarquardtReg, grad::MaterialGradient,
                   material::Material)

Rescale the Marquardt solution: Δθ[k] /= D_k for relevant parameters.

source

Post-Processing Methods

Van Houten

Clips power-law exponents to [αmin,αmax].

Sentinel.VanHoutenReg Type
julia
VanHoutenReg <: AbstractRegularization

Van Houten post-processing regularization.

Clips power-law exponent values prop.rvalue[k, 2] and prop.ivalue[k, 2] to the range [-level, level] for properties with nvpp >= 3.

Fields

  • level::Float64: maximum allowed power-law exponent magnitude
source
Sentinel.apply_van_houten! Function
julia
apply_van_houten!(material::Material, reg::VanHoutenReg)

Clip power-law exponents in all properties with nvpp >= 3 to [-level, level].

source

Spatial Filter

Gaussian smoothing with widths (σx,σy,σz).

Sentinel.SpatialFilterReg Type
julia
SpatialFilterReg <: AbstractRegularization

Spatial filter (Gaussian smoothing) post-processing regularization.

Fields

  • prop_index::Int: which material property (1-based)

  • sigma_real_init::Float64: initial Gaussian width for real part

  • sigma_real_final::Float64: final Gaussian width for real part

  • sigma_imag_init::Float64: initial Gaussian width for imaginary part

  • sigma_imag_final::Float64: final Gaussian width for imaginary part

  • max_iter::Int: total global iterations (for weight interpolation)

  • const_reg_iters::Int: constant regularization iterations at end

  • cutoff_multiplier::Float64: neighbor search radius = max_sigma × cutoff_multiplier

  • mtrl_mesh::MaterialMesh: material mesh for coordinate lookup

  • neighbor_indices::Vector{Vector{Int}}: precomputed neighbor lists per node

  • neighbor_distances::Vector{Vector{Float64}}: precomputed distances per node

  • region_info::Union{RegionInfo, Nothing}: optional region constraints

  • sensitivity_mask::Union{BitVector, Nothing}: optional mask for GP-covered nodes (Fortran nodsense)

source
Sentinel.apply_spatial_filter! Function
julia
apply_spatial_filter!(material::Material, reg::SpatialFilterReg;
                      iteration::Int=1)

Apply Gaussian spatial smoothing to material property values: θ_filtered[i] = Σ_j w_j·θ_j / Σ_j w_j where w_j = exp(−d²/(2σ²)).

Sigma is interpolated between init and final values based on iteration.

source

Bounds (McGarry)

Enforces Poisson ratio bounds via clipping.

Sentinel.BoundsReg Type
julia
BoundsReg <: AbstractRegularization

McGarry bounds post-processing regularization.

Fields

  • max_poisson::Float64: maximum allowed Poisson's ratio (e.g., 0.485) for Model 3

  • property_bounds::Vector{PropertyBounds}: per-property min/max constraints

source
Sentinel.apply_mcgarry_bounds! Function
julia
apply_mcgarry_bounds!(material::Material, reg::BoundsReg)

Enforce material property bounds (post-processing, no gradient contribution).

  1. General min/max clamping: for each constrained property, clamp scalar * rvalue to [min, max] (matching Fortran mcgarrybounds.f90).

  2. Model 3 Poisson ratio: clamp λ so that ν ≤ ν_max.

source

CG Update Scaling

Sentinel.cg_update_scale Function
julia
cg_update_scale(alpha, material_orig, material_new, threshold) -> Float64

Scale the CG step size alpha so that the relative material change does not exceed threshold.

Computes eps = material_epsilon(orig, new), then:

  • If eps > threshold: return alpha * threshold / eps

  • Otherwise: return alpha unchanged

source