Hi,
I am trying to recreate this paper: Continuous Learning in Single Incremental Tasks 8
And one of the algorithms in the paper involves training the final layer w.r.t to a loss function (eg. cross-entropy), but learning all preceding layers using a regularization term in addition to the back-propagated loss. So I know that adding a regularization term for the entire network is done by just adding the term as a Variable to the loss functions value during the step:
loss += regularization_term
loss.backward()
opt.step()
but according to my understanding that modifies the loss for the entire network, thus am stuck on how to change the loss only for all layers except the final layer.
Any advice and help in this manner would be very helpful.