Skip to content

Commit

Permalink
[examples] switch examples + models to Input layers
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Feb 26, 2016
1 parent 0d9a78f commit 2cc3844
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 89 deletions.
11 changes: 5 additions & 6 deletions examples/cifar10/cifar10_full.prototxt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: "CIFAR10_full_deploy"
# N.B. input image must be in CIFAR-10 format
# as described at http://www.cs.toronto.edu/~kriz/cifar.html
input: "data"
input_shape {
dim: 1
dim: 3
dim: 32
dim: 32
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 1 dim: 3 dim: 32 dim: 32 } }
}
layer {
name: "conv1"
Expand Down
11 changes: 5 additions & 6 deletions examples/cifar10/cifar10_quick.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "CIFAR10_quick_test"
input: "data"
input_shape {
dim: 1
dim: 3
dim: 32
dim: 32
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 1 dim: 3 dim: 32 dim: 32 } }
}
layer {
name: "conv1"
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp_classification/classification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ std::vector<float> Classifier::Predict(const cv::Mat& img) {

Preprocess(img, &input_channels);

net_->ForwardPrefilled();
net_->Forward();

/* Copy the output layer to a std::vector */
Blob<float>* output_layer = net_->output_blobs()[0];
Expand Down
11 changes: 5 additions & 6 deletions examples/mnist/lenet.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "LeNet"
input: "data"
input_shape {
dim: 64
dim: 1
dim: 28
dim: 28
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 64 dim: 1 dim: 28 dim: 28 } }
}
layer {
name: "conv1"
Expand Down
43 changes: 21 additions & 22 deletions examples/net_surgery.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5494,48 +5494,47 @@
"name": "stdout",
"output_type": "stream",
"text": [
"1,2c1\r\n",
"1,2c1,2\r\n",
"< # Fully convolutional network version of CaffeNet.\r\n",
"< name: \"CaffeNetConv\"\r\n",
"---\r\n",
"> name: \"CaffeNet\"\r\n",
"4c3\r\n",
"< input_dim: 1\r\n",
"> input: \"data\"\r\n",
"7,11c7\r\n",
"< input_param {\r\n",
"< # initial shape for a fully convolutional network:\r\n",
"< # the shape can be set for each input by reshape.\r\n",
"< shape: { dim: 1 dim: 3 dim: 451 dim: 451 }\r\n",
"< }\r\n",
"---\r\n",
"> input_dim: 10\r\n",
"6,7c5,6\r\n",
"< input_dim: 451\r\n",
"< input_dim: 451\r\n",
"---\r\n",
"> input_dim: 227\r\n",
"> input_dim: 227\r\n",
"152,153c151,152\r\n",
"> input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }\r\n",
"157,158c153,154\r\n",
"< name: \"fc6-conv\"\r\n",
"< type: \"Convolution\"\r\n",
"---\r\n",
"> name: \"fc6\"\r\n",
"> type: \"InnerProduct\"\r\n",
"155,156c154,155\r\n",
"160,161c156,157\r\n",
"< top: \"fc6-conv\"\r\n",
"< convolution_param {\r\n",
"---\r\n",
"> top: \"fc6\"\r\n",
"> inner_product_param {\r\n",
"158d156\r\n",
"163d158\r\n",
"< kernel_size: 6\r\n",
"164,165c162,163\r\n",
"169,170c164,165\r\n",
"< bottom: \"fc6-conv\"\r\n",
"< top: \"fc6-conv\"\r\n",
"---\r\n",
"> bottom: \"fc6\"\r\n",
"> top: \"fc6\"\r\n",
"170,171c168,169\r\n",
"175,176c170,171\r\n",
"< bottom: \"fc6-conv\"\r\n",
"< top: \"fc6-conv\"\r\n",
"---\r\n",
"> bottom: \"fc6\"\r\n",
"> top: \"fc6\"\r\n",
"177,181c175,179\r\n",
"182,186c177,181\r\n",
"< name: \"fc7-conv\"\r\n",
"< type: \"Convolution\"\r\n",
"< bottom: \"fc6-conv\"\r\n",
Expand All @@ -5547,21 +5546,21 @@
"> bottom: \"fc6\"\r\n",
"> top: \"fc7\"\r\n",
"> inner_product_param {\r\n",
"183d180\r\n",
"188d182\r\n",
"< kernel_size: 1\r\n",
"189,190c186,187\r\n",
"194,195c188,189\r\n",
"< bottom: \"fc7-conv\"\r\n",
"< top: \"fc7-conv\"\r\n",
"---\r\n",
"> bottom: \"fc7\"\r\n",
"> top: \"fc7\"\r\n",
"195,196c192,193\r\n",
"200,201c194,195\r\n",
"< bottom: \"fc7-conv\"\r\n",
"< top: \"fc7-conv\"\r\n",
"---\r\n",
"> bottom: \"fc7\"\r\n",
"> top: \"fc7\"\r\n",
"202,206c199,203\r\n",
"207,211c201,205\r\n",
"< name: \"fc8-conv\"\r\n",
"< type: \"Convolution\"\r\n",
"< bottom: \"fc7-conv\"\r\n",
Expand All @@ -5573,9 +5572,9 @@
"> bottom: \"fc7\"\r\n",
"> top: \"fc8\"\r\n",
"> inner_product_param {\r\n",
"208d204\r\n",
"213d206\r\n",
"< kernel_size: 1\r\n",
"214c210\r\n",
"219c212\r\n",
"< bottom: \"fc8-conv\"\r\n",
"---\r\n",
"> bottom: \"fc8\"\r\n"
Expand Down
15 changes: 9 additions & 6 deletions examples/net_surgery/bvlc_caffenet_full_conv.prototxt
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Fully convolutional network version of CaffeNet.
name: "CaffeNetConv"
input: "data"
input_shape {
dim: 1
dim: 3
dim: 451
dim: 451
layer {
name: "data"
type: "Input"
top: "data"
input_param {
# initial shape for a fully convolutional network:
# the shape can be set for each input by reshape.
shape: { dim: 1 dim: 3 dim: 451 dim: 451 }
}
}
layer {
name: "conv1"
Expand Down
11 changes: 5 additions & 6 deletions examples/net_surgery/conv.prototxt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Simple single-layer network to showcase editing model parameters.
name: "convolution"
input: "data"
input_shape {
dim: 1
dim: 1
dim: 100
dim: 100
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 1 dim: 1 dim: 100 dim: 100 } }
}
layer {
name: "conv"
Expand Down
13 changes: 7 additions & 6 deletions examples/siamese/mnist_siamese.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: "mnist_siamese"
input: "data"
input_shape {
dim: 10000
dim: 1
dim: 28
dim: 28
layer {
name: "data"
type: "Input"
top: "data"
input_param {
shape: { dim: 10000 dim: 1 dim: 28 dim: 28 }
}
}
layer {
name: "conv1"
Expand Down
11 changes: 5 additions & 6 deletions models/bvlc_alexnet/deploy.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "AlexNet"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 227
dim: 227
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
}
layer {
name: "conv1"
Expand Down
11 changes: 5 additions & 6 deletions models/bvlc_googlenet/deploy.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "GoogleNet"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 224
dim: 224
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 10 dim: 3 dim: 224 dim: 224 } }
}
layer {
name: "conv1/7x7_s2"
Expand Down
11 changes: 5 additions & 6 deletions models/bvlc_reference_caffenet/deploy.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "CaffeNet"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 227
dim: 227
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
}
layer {
name: "conv1"
Expand Down
11 changes: 5 additions & 6 deletions models/bvlc_reference_rcnn_ilsvrc13/deploy.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "R-CNN-ilsvrc13"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 227
dim: 227
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
}
layer {
name: "conv1"
Expand Down
11 changes: 5 additions & 6 deletions models/finetune_flickr_style/deploy.prototxt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: "FlickrStyleCaffeNet"
input: "data"
input_shape {
dim: 10
dim: 3
dim: 227
dim: 227
layer {
name: "data"
type: "Input"
top: "data"
input_param { shape: { dim: 10 dim: 3 dim: 227 dim: 227 } }
}
layer {
name: "conv1"
Expand Down

0 comments on commit 2cc3844

Please sign in to comment.