Keeping one Fisher per task grows memory with the number of tasks. Two fixes keep a single importance vector: online EWC decays and accumulates the Fisher, and Synaptic Intelligence (SI) accumulates importance during training from the path the parameters take.
online_ewc_update(omega_prev, fisher_new, gamma)
omega_prev and fisher_new are (P,) arrays (the running importance and the Fisher estimated on the task just finished), gamma a float in .si_path_integral(grads, deltas)
grads and deltas are (K, P) arrays: at each of the optimiser steps of a task, the gradient of the task loss and the parameter change actually applied ().(P,) per-parameter contribution , the negative path integral of the gradient; for plain gradient descent every term is non-negative.si_importance(omega, theta_start, theta_end, xi)
(P,) SI importance , where xi is a small damping constant.accumulate_si(Omega_prev, omega, theta_start, theta_end, xi)
Omega_prev + si_importance(omega, theta_start, theta_end, xi).