torch/nn — pull request #19 by jonathantompson (2014-06-25 21:00:23+00:00)
Title: Added very simple add and mul constant modules.

This is a simple commit. I've added 2 modules that simple multiple or add a non-trainable scalar constant.

I've found these two modules are really handy when debugging numerical precision issues (ie if you're getting NaNs because you think you're taking the Log of negative numbers, you can add a giant constant bias in front just to check). It's also helpful when you want to perform rescaling of ranges (ie [0,pi] --> [-1, 1] for instance).