NeuroFade

Watch your neural network forget in real time. Layer by layer. Neuron by neuron. Catastrophic forgetting visualized.

pip install neurofade View on PyPI
neurofade — live forgetting simulation

Catastrophic Forgetting Is Invisible

When you fine-tune a model on new data, it silently overwrites what it learned before. You don't see the damage until testing — and by then it's too late.

🔬

Per-Layer Tracking

See exactly which layers degrade first. Pinpoint the forgetting bottleneck in your architecture.

📹

Export as GIF

Shareable artifacts that tell a story. Post your model's "death" on Twitter. That's viral content.

One-Line Integration

Wrap your training loop with viz.watch(). Works with any PyTorch model automatically.

🧠

Retention Scores

Per-neuron activation retention. Know if your model is 90% alive or 10% alive. Quantify the damage.

How It Works

1

Capture Baseline

Run your trained model on reference data. NeuroFade records per-neuron activation magnitudes as thehealthy state.

2

Watch Training

Train on new data inside viz.watch(). Forward hooks capture activations every step and compare against baseline.

3

See Forgetting

Export as GIF, print a summary table, or pipe into your monitoring. Layer 7 at 0%? Now you know where to fix.

# After training on Task 1 from neurofade import ForgettingVisualizer viz = ForgettingVisualizer(model) viz.set_baseline(task1_loader) # Train on Task 2 — forgetting happens here with viz.watch(): trainer.fit(task2_loader) # See the damage viz.summary() # terminal table viz.export("forgetting.gif") # shareable artifact
4
Hook Types
Models Supported
1
Line to Integrate

🔗 On-Chain Trust — Base Integration

Post verifiable AI model health certificates to Base mainnet. One tx hash = one immutable proof your model hasn't forgotten.

🔐

Immutable Proof

SHA-256 report hash posted on-chain. Anyone can verify your model's health — no trust required.

🤖

AI Agent Trust

Virtuals & ERC-8004 agents can post attestations before each update. Users verify before trusting.

Zero Gas

Calldata-only tx. No contract deploy, no ABI. Just a verifiable record on Base, forever.

🔍

Public Verification

Anyone can query the NFRD prefix on Basescan and audit every attestation ever posted.

post_to_base.py
from neurofade import ForgettingVisualizer
from neurofade.chain.attestation import post_attestation

viz = ForgettingVisualizer(model)
viz.set_baseline(task_a_loader)

with viz.watch():
    train(model, task_b_loader)  # forgetting happens here

# Post health certificate to Base
cert = post_attestation(viz, private_key="0x...", model=model)
print(cert.tx_hash)  # basescan.org/tx/0x...

Install with chain support: pip install neurofade[chain]

Install

$ pip install neurofade Copied!

Requires Python ≥ 3.9 · PyTorch ≥ 2.0 · Pillow ≥ 9.0