Skip to content

pettza/EWC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elastic Weight Consolidation in PyTorch

This is an implementation of Elastic Weight Consolidation (EWC)1 in PyTorch

Example

import torch.nn.functional as F
from ewc import EWC

module = ...
samples = ...

f = lambda m, s: F.log_softmax(m(s))

ewc = EWC(module, samples, f)

# Code that changes module

l = ewc.loss(module)

Acknowledgements

The method for calculating the jacobian with respect to the models parameters was based on NNGeometry.

1: James Kirkpatrick, et al. "Overcoming catastrophic forgetting in neural networks". CoRR abs/1612.00796. (2016).

About

Elastic Weight Consolidation in PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages