Repository: continualai/avalanche
Issue: Synaptic Intelligence implementation differs from the paper?

I was looking at Synaptic Intelligence implementation in [here](https://github.com/vlomonaco/avalanche/blob/master/avalanche/training/strategies/syn_int/utils.py). 

**Problem 1:**** line 103, when computing the cumulative trajectory (that is, the weight importance Big Omega), the parameter `c` is multiplied to the current trajectory (small omega in the paper). However, I think that, by following Eq. 4 in the paper, `c` should only be used as the hyperparameter weighting the loss and the penalty, like the `lambda` of EWC. In Eq. 5 in fact there is no `c` when computing cumulative trajectory.  In line 129 the penalty is weighted by `lambda`, so I am confused about it.  
**Proposed solutionI** I would remove the `c` in line 103 and substituting `lambda` with `c` in line 129.

**Problem 2:** The trajectory (small omega) is computed in line 95. The gradient taken in input however, is the gradient of the entire loss function (classification loss + Synaptic Intelligence penalty). In the original paper (Eq. 3 and explanation below) the gradient is taken with respect to the classification loss only.  
**Proposed solution** The only way to achieve this in our framework is to do all the computation in the `compute_loss`, by first computing classification loss, getting gradients (`retain_graph=True`), updating trajectory, add penalty, add gradient with respect to the penalty to the previous gradients and optimize parameters.

Do you agree with this or am I missing something?

Changed files:
avalanche/training/plugins/synaptic_intelligence.py, avalanche/training/strategies/strategy_wrappers.py

diff --git a/avalanche/training/plugins/synaptic_intelligence.py b/avalanche/training/plugins/synaptic_intelligence.py
index df33e941..5e8f917f 100644
--- a/avalanche/training/plugins/synaptic_intelligence.py
+++ b/avalanche/training/plugins/synaptic_intelligence.py
@@ -23,8 +23,13 @@ class SynapticIntelligencePlugin(StrategyPlugin):
     The Synaptic Intelligence plugin.
 
     This is the Synaptic Intelligence PyTorch implementation of the
-    algorithm described in the paper "Continual Learning Through Synaptic
-    Intelligence" (https://arxiv.org/abs/1703.04200).
+    algorithm described in the paper
+    "Continuous Learning in Single-Incremental-Task Scenarios"
+    (https://arxiv.org/abs/1806.08568)
+
+    The original implementation has been proposed in the paper
+    "Continual Learning Through Synaptic Intelligence"
+    (https://arxiv.org/abs/1703.04200).
 
     This plugin can be attached to existing strategies to achieve a
     regularization effect.
diff --git a/avalanche/training/strategies/strategy_wrappers.py b/avalanche/training/strategies/strategy_wrappers.py
index d2c876ba..09dd3e1c 100644
--- a/avalanche/training/strategies/strategy_wrappers.py
+++ b/avalanche/training/strategies/strategy_wrappers.py
@@ -397,8 +397,13 @@ class SynapticIntelligence(BaseStrategy):
     The Synaptic Intelligence strategy.
 
     This is the Synaptic Intelligence PyTorch implementation of the
-    algorithm described in the paper "Continual Learning Through Synaptic
-    Intelligence" (https://arxiv.org/abs/1703.04200).
+    algorithm described in the paper
+    "Continuous Learning in Single-Incremental-Task Scenarios"
+    (https://arxiv.org/abs/1806.08568)
+
+    The original implementation has been proposed in the paper
+    "Continual Learning Through Synaptic Intelligence"
+    (https://arxiv.org/abs/1703.04200).
 
     The Synaptic Intelligence regularization can also be used in a different
     strategy by applying the :class:`SynapticIntelligencePlugin` plugin.