Skip to content

Instantly share code, notes, and snippets.

@farrajota
Created September 6, 2016 14:17
Show Gist options
  • Save farrajota/415e889fe78b476167781d01df9cfe98 to your computer and use it in GitHub Desktop.
Save farrajota/415e889fe78b476167781d01df9cfe98 to your computer and use it in GitHub Desktop.
freeze parameters of a layer
model.modules[1].parameters = function() return nil end -- freezes the layer when using optim
model.modules[1].accGradParameters = function() end -- overwrite this to reduce computations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment