Skip to content

Add conditional alpha capping, PolarPhase line-search scaling, and optimizer options#9

Open
Fuwsusu wants to merge 2 commits into
mainfrom
codex/fix-mismatched-denominator-in-line-search-4vkuoa
Open

Add conditional alpha capping, PolarPhase line-search scaling, and optimizer options#9
Fuwsusu wants to merge 2 commits into
mainfrom
codex/fix-mismatched-denominator-in-line-search-4vkuoa

Conversation

@Fuwsusu

@Fuwsusu Fuwsusu commented Apr 11, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Stabilize gradient-based updates and avoid over-clipping by introducing a conditional alpha cap that only triggers under identified risk conditions.
  • Correct the line-search scaling mismatch when using the PolarPhase misfit by applying a lightweight denominator scaling tied to the phase/amplitude weight.
  • Expose optimizer-related parameters for reproducibility and saving so runs can be replayed and post-analysed.

Description

  • Added optimizer options enableConditionalAlphaCap and alpha_cap_percentile and adjusted comments to clarify alpha_ls/alpha_cap behavior and target_dv_per_iter semantics.
  • Implemented PolarPhase line-search denominator correction by computing a weighted squared term and replacing the L2 denominator when misfitType == 'PolarPhase'.
  • Introduced risk-detection flags (bad_fit_flag, tau_rise_flag, ring_rise_flag) and enabled conditional application of the hard step-size cap using a quantile-based sd_ref instead of max(abs(search_dir)).
  • Rewired the trust-gate logic to reuse the new risk flags and persist the new optimizer variables (optimizerType, target_dv_per_iter, enableConditionalAlphaCap, alpha_cap_percentile) into the results file, and made the three-stage reference saves conditional with exist checks.

Testing

  • Performed a smoke integration run of MultiFrequencyWaveformInvkWave_fws20260409_2new.m on a small sample frequency set and confirmed the script completes without runtime errors and produces filename_results.
  • Verified that the saved results file contains the newly persisted optimizer variables and that the updated alpha computation path is exercised when misfitType is set to PolarPhase.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant