This repo implements a simple REINFORCE policy-gradient agent that trains sequentially on multiple OpenAI Gym tasks while using Elastic Weight Consolidation (EWC) to reduce catastrophic forgetting.
- Create virtualenv and install:
This script trains on CartPole-v1, computes EWC constraints, then continues training on MountainCar-v0 using EWC.
main.py: Orchestrator / pipelinetrain.py: Training loop helperagent.py: Agent implementation (REINFORCE)model.py: Policy neural networkewc.py: EWC implementation (Fisher estimation + penalty)utils.py: env compatibility helpers, plotting, saving