nicholas-leonard / dp

A deep learning library for streamlining research and development using the Torch7 distribution.
Other
343 stars 140 forks source link

Transfer Learning - how to "fix" weights in certain modules #188

Closed jrbtaylor closed 8 years ago

jrbtaylor commented 8 years ago

I'm working on an application where a CNN feeds into an RNN and am attempting to use an ImageNet pre-trained CNN. Is there a way to fix the weights in just that one module so they're not updated during training?

nicholas-leonard commented 8 years ago

@jrbtaylor Yes. Just overload the accGradParameters call :

module = loadMyImageNetModel()
module.accGradParameters = function(self) end