NEATdocs

Configuration

Every NEAT optimizer argument, grouped by what it controls.

All research options default to off, so a plain NEAT(learning_rate=..., alpha=...) uses the original nce_spec_v2 update.

Core

ArgumentDefaultEffect
learning_rate1e-3Optimizer step size
alpha0.25Correction strength (0 disables the correction entirely)
beta0.9Momentum decay

Opponent signal

What counts as the conflict opponent, set with opponent_source:

ValueBehaviour
"momentum" (default)Uses the accumulated momentum vector
"gradient_ema"Uses an exponential moving average of raw gradients
"previous_gradient"Uses the previous raw gradient
"blended"Weighted mix of momentum and gradient EMA

Correction controls

ArgumentDefaultEffect
nce_mode"projection""projection", "cosine", or "off"
nce_clip_ratio1.0Maximum correction size as a fraction of the gradient norm
correction_warmup_steps0Steps before the correction activates
conflict_threshold0.0Minimum conflict ratio before any correction is applied

Adaptive features

ArgumentDefaultEffect
adaptive_alphaFalseCorrection strength responds to conflict, noise, and alignment trends
adaptive_correctionFalseScale the correction by opponent reliability and conflict EMA
adaptive_correction_decay0.9EMA decay for adaptive correction
adaptive_correction_min_scale1.0Lower clamp on the adaptive scale
adaptive_correction_max_scale3.0Upper clamp on the adaptive scale
adaptive_preconditioningFalseAdam-style diagonal second-moment preconditioner
second_moment_beta0.999Decay for the second-moment EMA
bias_correctionFalseBias-correct momentum and second moment

Training stabilizers

Useful for benchmark ablations. These compose established techniques with the NEAT correction; they are not new contributions.

ArgumentEffect
update_mode="lion"Lion-style sign update after the NEAT correction
gradient_centralization=TrueCenter matrix-like gradients before the update
nesterov=TrueNesterov-style momentum
lookahead_k > 0Lookahead slow-weight synchronization every k steps

Sparsity and weight decay

ArgumentDefaultEffect
weight_decay0.0L2 weight decay coefficient
decouple_weight_decayTrueApply decay before the gradient step (AdamW-style)
sparsity_l10.0Soft L1 shrinkage after each step
prune_threshold0.0Hard-zero weights below this magnitude

Spec version

ArgumentDefaultEffect
spec_version"nce_spec_v2"Pass "nce_spec_v3" to opt in to the additive research controls described in Algorithm

Example

from neat_optim import NEAT

optimizer = NEAT(
    learning_rate=1e-3,
    alpha=0.25,
    beta=0.9,
    nce_mode="projection",
    opponent_source="gradient_ema",
    correction_warmup_steps=5,
    adaptive_alpha=True,
    adaptive_preconditioning=True,
)

On this page