Current collected state Current
Observed since 20 Oct, 21:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Adaptive Forgetting Optimizer for PyTorch
AFOR is a tensor-wise adaptive forgetting optimizer for PyTorch. It adapts the second-moment decay coefficient from local gradient residuals, direction consistency, and online Z-score normalization.
pip install afor-optimizer
import torch
from AFOR import afor
model = torch.nn.Linear(10, 2)
optimizer = afor(
model.parameters(),
lr=1e-3,
betas=(0.9, 0.999),
beta2_min=0.99,
dir_weight=1.0,
weight_decay=1e-4,
)
inputs = torch.randn(16, 10)
targets = torch.randint(0, 2, (16,))
loss = torch.nn.functional.cross_entropy(model(inputs), targets)
loss.backward()
optimizer.step()
optimizer.zero_grad()
lr: learning rate.betas: first-moment and initial second-moment coefficients.beta2_min: lower bound for the adaptive second-moment coefficient.dir_weight: weight of gradient-direction consistency.eps: numerical stability term.weight_decay: decoupled weight decay.fast_ref: use the larger fast/slow noise estimate as the noise reference.AFOR currently supports dense gradients only.
Released under the MIT License. See LICENSE.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.0 | 14 Sept 2026 | 1 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 21:10 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:0f59d0e0999b8f44b1b1bf6f2bf33efd2dad8557628d5b2c2dbbde21fc0783b4