Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/mnist.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You will first need to download and convert the data format from the MNIST websi

cd $CAFFE_ROOT/data/mnist
./get_mnist.sh
cd $CAFFE_ROOT/examples/lenet
cd $CAFFE_ROOT/examples/mnist
./create_mnist.sh

If it complains that `wget` or `gunzip` are not installed, you need to install them respectively. After running the script there should be two datasets, `mnist-train-leveldb`, and `mnist-test-leveldb`.
Expand All @@ -33,7 +33,7 @@ Training and Testing the Model

Training the model is simple after you have written the network definition protobuf and solver protobuf files. Simply run `train_mnist.sh`, or the following command directly:

cd $CAFFE_ROOT/examples/lenet
cd $CAFFE_ROOT/examples/mnist
./train_lenet.sh

`train_lenet.sh` is a simple script, but here are a few explanations: `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `train_net.bin`, with the solver protobuf text file as its argument.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions examples/mnist/mnist_autoencoder_solver.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
train_net: "mnist_autoencoder_train.prototxt"
test_net: "mnist_autoencoder_test.prototxt"
test_iter: 50
test_interval: 100
test_compute_loss: true
base_lr: 0.0001
lr_policy: "fixed"
display: 20
max_iter: 4000000
weight_decay: 0.0005
snapshot: 10000
snapshot_prefix: "mnist_autoencoder_train"
momentum: 0.9
solver_mode: 1
145 changes: 145 additions & 0 deletions examples/mnist/mnist_autoencoder_test.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: "MNISTAutoencoder"
layers {
top: "data"
name: "data"
type: DATA
data_param {
source: "mnist-test-leveldb"
scale: 0.0039215684
batch_size: 100
}
}
layers {
bottom: "data"
top: "flatdata"
name: "flatdata"
type: FLATTEN
}
layers {
bottom: "data"
top: "encode1"
name: "encode1"
type: INNER_PRODUCT
inner_product_param {
num_output: 1000
}
}
layers {
bottom: "encode1"
top: "encode1neuron"
name: "encode1neuron"
type: SIGMOID
}
layers {
bottom: "encode1neuron"
top: "encode2"
name: "encode2"
type: INNER_PRODUCT
inner_product_param {
num_output: 500
}
}
layers {
bottom: "encode2"
top: "encode2neuron"
name: "encode2neuron"
type: SIGMOID
}
layers {
bottom: "encode2neuron"
top: "encode3"
name: "encode3"
type: INNER_PRODUCT
inner_product_param {
num_output: 250
}
}
layers {
bottom: "encode3"
top: "encode3neuron"
name: "encode3neuron"
type: SIGMOID
}
layers {
bottom: "encode3neuron"
top: "encode4"
name: "encode4"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 1
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 30
}
}
layers {
bottom: "encode4"
top: "decode4"
name: "decode4"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 1
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 250
}
}
layers {
bottom: "decode4"
top: "decode4neuron"
name: "decode4neuron"
type: SIGMOID
}
layers {
bottom: "decode4neuron"
top: "decode3"
name: "decode3"
type: INNER_PRODUCT
inner_product_param {
num_output: 500
}
}
layers {
bottom: "decode3"
top: "decode3neuron"
name: "decode3neuron"
type: SIGMOID
}
layers {
bottom: "decode3neuron"
top: "decode2"
name: "decode2"
type: INNER_PRODUCT
inner_product_param {
num_output: 1000
}
}
layers {
bottom: "decode2"
top: "decode2neuron"
name: "decode2neuron"
type: SIGMOID
}
layers {
bottom: "decode2neuron"
top: "decode1"
name: "decode1"
type: INNER_PRODUCT
inner_product_param {
num_output: 784
}
}
layers {
bottom: "decode1"
top: "decode1neuron"
name: "decode1neuron"
type: SIGMOID
}
layers {
bottom: "decode1neuron"
bottom: "flatdata"
name: "loss"
type: EUCLIDEAN_LOSS
}
Loading