Skip to content
Closed
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
123 changes: 123 additions & 0 deletions examples/templates/aux_classifier.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# Auxiliary Classifer Module
# Requires: input
layers {
bottom: "${input}"
top: "ave_pool"
name: "ave_pool"
type: POOLING
pooling_param {
pool: AVE
kernel_size: 5
stride: 3
}
}
layers {
bottom: "ave_pool"
top: "conv"
name: "conv"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
convolution_param {
num_output: 128
kernel_size: 1
weight_filler {
type: "xavier"
std: 0.08
}
bias_filler {
type: "constant"
value: 0.2
}
}
}
layers {
bottom: "conv"
top: "conv"
name: "relu_conv"
type: RELU
}
layers {
bottom: "conv"
top: "fc"
name: "fc"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 1024
weight_filler {
type: "xavier"
std: 0.02
}
bias_filler {
type: "constant"
value: 0.2
}
}
}
layers {
bottom: "fc"
top: "fc"
name: "relu_fc"
type: RELU
}
layers {
bottom: "fc"
top: "fc"
name: "drop_fc"
type: DROPOUT
dropout_param {
dropout_ratio: 0.7
}
}
layers {
bottom: "fc"
top: "classifier"
name: "classifier"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 1000
weight_filler {
type: "xavier"
std: 0.0009765625
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
bottom: "classifier"
bottom: "../label"
name: "loss"
type: SOFTMAX_LOSS
loss_weight: 0.3
top: "loss1"
}
layers {
name: "top-1"
type: ACCURACY
bottom: "classifier"
bottom: "../label"
top: "top-1"
include: { phase: TEST }
}
layers {
name: "top-5"
type: ACCURACY
bottom: "classifier"
bottom: "../label"
top: "top-5"
accuracy_param: { top_k: 5 }
include: { phase: TEST }
}
30 changes: 30 additions & 0 deletions examples/templates/convolution_with_relu.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Convolution with ReLU
# Required: input, num_output, kernel_size
layers: {
name: "convolution"
type: CONVOLUTION
bottom: "${input}"
top: "output"
blobs_lr: 1.
blobs_lr: 2.
weight_decay: 1.
weight_decay: 0.
convolution_param {
num_output: ${num_output}
kernel_size: ${kernel_size}
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers: {
name: "relu"
type: RELU
bottom: "output"
top: "output"
}
58 changes: 58 additions & 0 deletions examples/templates/example_net.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: "TemplateNetwork"
layers: {
name: "data"
type: DUMMY_DATA
dummy_data_param {
num: 5
channels: 2
height: 3
width: 4
num: 5
channels: 1
height: 1
width: 1
data_filler {
type: "gaussian"
std: 0.01
}
}
top: "data"
top: "label"
}
layers: {
name: "conv1"
type: TEMPLATE
template_param {
source: "examples/templates/convolution_with_relu.template"
variable { name: "input" value: "/data" }
variable { name: "num_output" value: "10" }
variable { name: "kernel_size" value: "3" }
}
}
layers: {
name: "fc1"
type: TEMPLATE
template_param {
source: "examples/templates/innerproduct_with_dropout.template"
variable { name: "input" value: "/conv1/output" }
variable { name: "num_output" value: "10" }
variable { name: "dropout_ratio" value: "0.5" }
}
}
layers: {
name: "fc2"
type: TEMPLATE
template_param {
source: "examples/templates/innerproduct_with_dropout.template"
variable { name: "input" value: "../fc1/output" }
variable { name: "num_output" value: "20" }
variable { name: "dropout_ratio" value: "0.0" }
}
}
layers: {
name: "loss"
type: SOFTMAX_LOSS
bottom: "fc2/output"
bottom: "label"
top: "top_loss"
}
4 changes: 4 additions & 0 deletions examples/templates/expand_net.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh

./build/tools/expand_net examples/templates/example_net.template examples/templates/example_net.prototxt
./build/tools/expand_net examples/templates/googlenet.template examples/templates/googlenet.prototxt
Loading