MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / step

Method step

src/machine_learning/optimization/adam.rs:91–119  ·  view source on GitHub ↗

Computes one update step. `params` holds the current parameter values θ_{t-1}. When `weight_decay` is `0.0` the update is standard Adam; any positive value applies the AdamW decoupled decay term `λ * θ_{t-1}` directly to the parameters, independent of the adaptive scaling. # Panics Panics if `gradients` and `params` have different lengths.

(&mut self, gradients: &[f64], params: &[f64])