LIU SHANGYU
LIU SHANGYU
> Shouldn't instead of > > `log_liklihoods.append(output[:, target])` > > We have > > `log_liklihoods.append(torch.gather(output, dim=1, index=target.unsqueeze(-1)))` > > ? > > Assume target size (batch size) is 64 and...
I implemented a version to compute `sum of squared gradients`. See [Here](https://github.com/shivamsaboo17/Overcoming-Catastrophic-forgetting-in-Neural-Networks/issues/7#issuecomment-1790310147).
It's short for `criterion`, i.e. the basic loss function. As shown by `demo.ipynb`, you can build a cross entropy loss for classification tasks: `crit = nn.CrossEntropyLoss()`.
To obtain **sum of squared gradients** instead of **squared sum of gradients**, we need to compute the gradient of log likelihood wrt each parameter. This process requires a sequential execution...
I encountered exactly the same error!