Skip to content

T adam 2026 - #368

Draft
farhadrclass wants to merge 21 commits into
JuliaSmoothOptimizers:mainfrom
Farhad-phd:T_ADAM_2026
Draft

T adam 2026#368
farhadrclass wants to merge 21 commits into
JuliaSmoothOptimizers:mainfrom
Farhad-phd:T_ADAM_2026

Conversation

@farhadrclass

Copy link
Copy Markdown
Contributor

No description provided.

Introduce a new unconstrained optimizer, `tadam`, with a full `TADAMSolver` implementation, configurable parameter set, trust-region step logic, momentum/RMS updates, and solver-specific stats (`avgβ1max`). Wire it into `JSOSolvers.jl` via `include("tadam.jl")`.

Also add a standalone `tadam_example` environment and test script that sets up a Rastrigin problem and compares TADAM against LBFGS for experimentation.
Move gradient evaluation and direction update to the start of each solver loop so the subproblem always uses a fresh direction, even on rejected steps. Dual residual stats are now updated every iteration, and redundant `d` recomputations in branch blocks were removed. The bias-correction denominator for `d` now uses `max(1, siter)` to avoid the `siter=0` edge case.
Refactors the TADAM iteration flow so step computation, acceptance, callback batch advancement, and next-direction preparation happen in a consistent order. Momentum/variance absorption now occurs only after accepted steps, and the next gradient/beta geometry is computed on the new batch after the callback. Rejected steps now reuse the current gradient/momentum and only recompute direction with a shrunk β1max. Also adds a ΔTk <= eps(T) guard to prevent Float32 underflow when computing ρk.
@farhadrclass
farhadrclass requested a review from d-monnet July 21, 2026 16:14
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 204 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.19%. Comparing base (52caf59) to head (66c457b).
⚠️ Report is 51 commits behind head on main.

Files with missing lines Patch % Lines
src/tadam.jl 0.00% 204 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #368       +/-   ##
===========================================
- Coverage   89.00%   76.19%   -12.81%     
===========================================
  Files           7        8        +1     
  Lines        1200     1420      +220     
===========================================
+ Hits         1068     1082       +14     
- Misses        132      338      +206     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/tadam.jl
Analytically finds the largest τ ∈ [0,1] satisfying both gradient-related conditions.
"""
function find_tau(sc::V, s_infty::V, g::V, κ1::T, κ2::T) where {V, T}
w = s_infty .- sc

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is memory allocation here, this is no good

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants