BVLC/caffe — pull request #357 by jeffdonahue (2014-04-24 09:23:00+00:00)
Title: Test before doing any training

This runs a test pass before training; i.e., from the initial parameters (perhaps from a pre-trained model). The reasons I'd advocate this are:

(1) Allows the user to gauge the effect of the first N iterations of training (where N = the `test_interval` you set in the solver prototxt)

(2) Caffe keeps both the train and test net in memory, but all the major blocks of memory in Caffe are lazily allocated -- i.e., they don't actually occupy any memory at all until they are actually read from or written to. It's possible to have enough memory to train, but to have the (usually smaller) test net push you over your host's/device's memory limit. Currently, in this situation, Caffe will crash during the first test iteration after N iterations of training. With this PR, Caffe should crash during the first training iteration, after just a single test pass.

If people would like, I could add a `SolverParameter` option like `bool test_initialization = 999 [ default=true ]` to toggle this.