BVLC/caffe — pull request #855 by jeffdonahue (2014-08-04 22:29:56+00:00)
Title: SGDSolver tests

This PR adds unit tests for the SGDSolver, checking that it correctly computes an update value for a least squares problem with a simple analytic gradient. All of these tests should fail if the gradient of the net is computed incorrectly (hence the tests assume that net->ForwardBackward and the forward/backward passes of `DummyDataLayer`, `InnerProductLayer`, and `EuclideanLossLayer` are correct). Some subset of the tests should fail if the solver incorrectly handles the learning rate, weight decay, and/or momentum (verified by modifying lines that handle these parameters in `solver.cpp`).

This will allow future solver changes to be made with greater confidence, and hopefully can serve as an example for unit tests to be written for @qipeng's #741 which adds other kinds of solvers.