BVLC/caffe — pull request #480 by jeffdonahue (2014-06-09 00:07:33+00:00)
Title: Dummy data layer

(Please merge #479 before this; this is based on #479 so I don't have to reformat `DummyDataLayer`'s header declaration after that one is merged. Sorry for the bad PR manners...I can rebase purely on dev if strongly preferred.)

This is a layer that outputs "dummy" data from a `Filler`, e.g. `ConstantFiller` or `GaussianFiller` to an arbitrary number of blobs of arbitrary sizes. It takes N >= 1 top blobs, 1 or N `num`s, `channels`s, `height`s, and `width`s and 0, 1, or N `data_filler`s. If there are 0 `data_filler`s, output all 0s to all top blobs. If there is exactly 1 of any of `num`, `channels`, `height`, `width`, `data_filler`, that value is used for all top blobs. If there are exactly N of any of `num`, `channels`, `height`, `width`, `data_filler`, use the ith value for the ith top blob.

For any `ConstantFiller`s, the data is filled during `SetUp` and never touched again in `Forward`. For all other filler types (all of which output random data), the data is filled on each iteration using `Forward`.

I can think of a couple use cases for this, including:

1) unit tests for an entire net where one might not want to create an entire temporary LevelDB (I use it for this purpose in later private commits, to be publicized soon).

2) regularization by use in combination with an `EltwiseLayer` (with `op == SUM`) to add random (e.g., Gaussian) noise to data in some layer of the net.