A network learned an old task and is now training on a new one. So it doesn’t forget the old task, training pays a cost for moving weights away from where the old task left them: how much worse the old task gets. Write forgetting_cost(old_weights, new_weights, importance). importance[i] is how much the old task’s loss rises when weight i moves by 1, either way: 0 means the old task doesn’t care about that weight.
| w1 | w2 | w3 |
|---|---|---|
| 0.5 | −1.2 | 2 |
| w1 | w2 | w3 |
|---|---|---|
| 2 | 0 | 5 |