EWC Fisher Importance
Use this skill after learning a previous task and before applying an EWC penalty. It converts per-example gradients into a nonnegative diagonal Fisher estimate and can compute normalized Fisher overlap diagnostics.
Inputs
- Per-example gradient vectors for the previous task.
- Optional Fisher vectors for normalization or overlap.
Outputs
- Mean squared-gradient Fisher vector.
- Trace-normalized Fisher vector.
- Fisher-overlap score for diagnostics.
Workflow
- Collect gradients at or near the previous-task solution.
- Square every gradient component.
- Average squared gradients across examples.
- Normalize by trace only for overlap/comparison diagnostics.
- Pass the unnormalized Fisher to the EWC penalty.
Validation
Run:
python tests/test_fisher_importance.py
Limitations
The helper expects gradient vectors supplied by a model-specific training harness. It does not compute autograd gradients itself.