clementfarabet/torch7-demos — pull request #6 by rlowrance (2014-02-01 21:57:35+00:00)
Title: scale data and externalize potentially useful functions

I notice that the SGD example as written gave terrible prediction accuracy. The cause is that the two input features are on very different scales. The age features averages about 31 and the is-female features averages around .5. Thus SGD is tricky to get to converge on the un-rescaled data, needed a very small step size and many iterations.

I rewrote the example to include scaling, adding the necessary explanations and code.

Also, I decided that some of the code could be reusable if it were in external modules, so I moved the relevant code to separate modules. Now there is a little kit for fitting multinomial logistic regression modules. For pedaggogical reasons, I left all the explanations of how to do logistic regression using the neural network package in the code.