Compute Elastic Weight Consolidation's Fisher-weighted quadratic penalty, gradient, and additive multi-task quadratic terms.
Scanned 9/9/2026
Install to Claude Code
npx -y skills add VectorSpaceLab/AREX-Skill --skill ewc_penalty --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Ewc Penalty?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/vectorspacelab-ewc-penalty)More formats (shields.io, HTML) on the badges page.
---
name: ewc_penalty
description: Compute Elastic Weight Consolidation's Fisher-weighted quadratic penalty, gradient, and additive multi-task quadratic terms.
---
# EWC Penalty
Use this skill when training a new task after estimating previous-task Fisher importance. It implements the paper equation `lambda / 2 * sum(F_i * (theta_i - theta_star_i)^2)` and the matching gradient.
## Inputs
- Current parameters `theta`.
- Previous optimum `theta_star`.
- Diagonal Fisher vector `fisher`.
- EWC multiplier `lambda_value`.
## Outputs
- Scalar EWC penalty.
- Gradient contribution to add to the new-task gradient.
- Optional summed penalty over multiple previous anchors.
## Workflow
1. Validate matching vector dimensions and nonnegative Fisher entries.
2. Compute parameter deltas from the old optimum.
3. Apply the paper's `lambda / 2` penalty scaling.
4. Add the gradient `lambda * fisher * delta` to the task-B gradient.
5. Sum penalties for multiple previous tasks when needed.
## Validation
Run:
```bash
python tests/test_ewc_penalty.py
```
## Limitations
This skill computes the consolidation term only. It must be combined with a task-specific loss in a training harness.
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!
Practical guide to testing web applications with screen readers for comprehensive accessibility validation.
在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。
Go测试模式包括表格驱动测试、子测试、基准测试、模糊测试和测试覆盖率。遵循TDD方法论,采用地道的Go实践。
Django测试策略,包括pytest-django、TDD方法论、factory_boy、模拟、覆盖率以及测试Django REST Framework API。
克劳德代码会话的正式评估框架,实施评估驱动开发(EDD)原则