--- library_name: clearn tags: - continual-learning - catastrophic-forgetting - ewc - pytorch license: mit --- # clearn Demo: EWC Continual Learning This model was trained with [clearn](https://github.com/itisrmk/clearn) — a continual learning library for PyTorch. ## What is this? A simple MLP trained on **3 sequential fraud detection tasks** using Elastic Weight Consolidation (EWC). Despite learning 3 tasks sequentially, the model retains 100% accuracy on all previous tasks. ## How to use ```bash pip install clearn-ai ``` ```python import clearn import torch.nn as nn # Recreate the architecture model = nn.Sequential(nn.Linear(128, 256), nn.ReLU(), nn.Linear(256, 10)) # Load the continual learning checkpoint cl_model = clearn.load("./checkpoint", model=model) # See retention across all tasks print(cl_model.diff()) ``` ## Retention Report ``` RetentionReport ├── fraud_q1: 100.0% retained ├── fraud_q2: 100.0% retained ├── fraud_q3: 100.0% retained ├── plasticity_score: 1.00 ├── stability_score: 1.00 └── recommendation: "stable — no action needed" ``` ## Strategy - **Strategy**: EWC (Elastic Weight Consolidation) - **Lambda**: 5000 - **Tasks**: 3 sequential fraud detection tasks - **Architecture**: MLP (128 → 256 → 10) Built with [clearn](https://github.com/itisrmk/clearn) — *Wrap once. Train forever.*