summaryrefslogtreecommitdiff
path: root/examples/mnist
diff options
context:
space:
mode:
authorChristos Nikolaou <christnn@auth.gr>2014-09-18 12:49:17 +0300
committerChristos Nikolaou <christnn@auth.gr>2014-09-18 12:49:17 +0300
commit1096ddefbaff09d4af4147dabd7d4a448334b074 (patch)
treef3c49b58554f0d8cc631c8d84007037b133dc157 /examples/mnist
parent3fc22b35b5fe1b08fb42dd631492270bd1ee4060 (diff)
downloadcaffeonacl-1096ddefbaff09d4af4147dabd7d4a448334b074.tar.gz
caffeonacl-1096ddefbaff09d4af4147dabd7d4a448334b074.tar.bz2
caffeonacl-1096ddefbaff09d4af4147dabd7d4a448334b074.zip
Updated mnist/readme.md file with additional information.
Diffstat (limited to 'examples/mnist')
-rw-r--r--examples/mnist/readme.md29
1 files changed, 16 insertions, 13 deletions
diff --git a/examples/mnist/readme.md b/examples/mnist/readme.md
index 2985240e..fe6e36a1 100644
--- a/examples/mnist/readme.md
+++ b/examples/mnist/readme.md
@@ -173,6 +173,22 @@ Finally, we will write the loss!
The `softmax_loss` layer implements both the softmax and the multinomial logistic loss (that saves time and improves numerical stability). It takes two blobs, the first one being the prediction and the second one being the `label` provided by the data layer (remember it?). It does not produce any outputs - all it does is to compute the loss function value, report it when backpropagation starts, and initiates the gradient with respect to `ip2`. This is where all magic starts.
+
+### Additional Notes: Writing Layer Rules
+
+The train and test protocol definition for the network is in the `lenet_train_test.prototxt` file, which differs from the `lenet.prototxt` file. In `lenet_train_test.prototxt` file, layers may include an additional definition, like the one below:
+
+
+ layers {
+ // Other layer definitions
+ include: { phase: TRAIN }
+ }
+
+This definition is a rule, which controls whether and when a layer is included in the network, based on current network's state. You can refeer to `$CAFFE_ROOT/src/caffe/proto/caffe.proto` for more information about layer's parameters.
+
+In the above example, this layer will be included only in `TRAIN` phase. If we change `TRAIN` with `TEST`, then this layer will be used only in test phase. Otherwise this layer will be used in both training and test phase. Thus, `lenet_train_test.prototxt` has two `DATA` layers defined (with different `batch_size`), one for the training phase and one for the testing phase. Also, there is an `ACCURACY` layer which is included only in `TEST` phase, because we want our network to report its accuracy every 100 iteration, as defined in `lenet_solver.prototxt`.
+
+
## Define the MNIST Solver
Check out the comments explaining each line in the prototxt `$CAFFE_ROOT/examples/mnist/lenet_solver.prototxt`:
@@ -203,19 +219,6 @@ Check out the comments explaining each line in the prototxt `$CAFFE_ROOT/example
# solver mode: CPU or GPU
solver_mode: GPU
-## Additional Notes
-
-Note that the train and test protocol definition for the network is in the `lenet_train_test.prototxt` file which differs from the `lenet.prototxt` file. In `lenet_train_test.prototxt file`, layers may include one additional definition, like the one below:
-
-
- layers {
-
- // Other layer definitions
-
- include: { phase: TRAIN }
- }
-
-This layer will be used only in training phase. If we change `TRAIN` with `TEST`, then this layer will be used only in test phase. Otherwise this layer will be used in both training and test phase. Thus `lenet_train_test.prototxt` has two `DATA` layers defined (with different `batch_size`), one for training and one for testing.
## Training and Testing the Model