Created
May 9, 2018 08:18
-
-
Save northeastsquare/63cd866c5e71814f5b04fd2ce9ad2425 to your computer and use it in GitHub Desktop.
xchen ResNet-18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "ResNet-18" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TRAIN | |
} | |
transform_param { | |
scale: 0.00390625 | |
mean_file: "/u02/xchen/char/ImageData/char/gray/gray135mean.binaryproto" | |
# crop_size: 128 | |
} | |
data_param { | |
source: "/u02/xchen/char/ImageData/char/gray/lmdb135train-2/" | |
batch_size: 256 | |
backend: LMDB | |
} | |
} | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
top: "label" | |
include { | |
phase: TEST | |
} | |
transform_param { | |
scale: 0.00390625 | |
mean_file: "/u02/xchen/char/ImageData/char/gray/gray135mean.binaryproto" | |
# crop_size: 128 | |
} | |
data_param { | |
source: "/u02/xchen/char/ImageData/char/gray/lmdb135val/" | |
batch_size: 1 | |
backend: LMDB | |
} | |
} | |
layer { | |
bottom: "data" | |
top: "conv1" | |
name: "conv1" | |
type: "Convolution" | |
convolution_param { | |
num_output: 24 | |
kernel_size: 5 | |
pad: 2 | |
stride: 2 | |
weight_filler { | |
type: "gaussian" | |
std: 0.01 | |
} | |
bias_filler { | |
type: "constant" | |
} | |
} | |
} | |
layer { | |
bottom: "conv1" | |
top: "conv1" | |
name: "conv1_relu" | |
type: "ReLU" | |
} | |
layer { | |
bottom: "conv1" | |
top: "pool1" | |
name: "pool1" | |
type: "Pooling" | |
pooling_param { | |
kernel_size: 3 | |
stride: 3 | |
pool: MAX | |
} | |
} | |
########################## | |
######first shortcut###### | |
########################## | |
layer { | |
bottom: "pool1" | |
top: "res2a_branch1" | |
name: "res2a_branch1" | |
type: "Convolution" | |
convolution_param { | |
num_output: 48 | |
kernel_size: 1 | |
pad: 0 | |
stride: 1 | |
bias_term: false | |
weight_filler { | |
type: "gaussian" | |
std: 0.01 | |
} | |
bias_filler { | |
type: "constant" | |
} | |
} | |
} | |
layer { | |
bottom: "pool1" | |
top: "res2a_branch2a" | |
name: "res2a_branch2a" | |
type: "ReLU" | |
} | |
layer { | |
bottom: "res2a_branch2a" | |
top: "res2a_branch2b" | |
name: "res2a_branch2b" | |
type: "Convolution" | |
convolution_param { | |
num_output: 48 | |
kernel_size: 3 | |
pad: 1 | |
stride: 1 | |
bias_term: false | |
weight_filler { | |
type: "gaussian" | |
std: 0.01 | |
} | |
bias_filler { | |
type: "constant" | |
} | |
} | |
} | |
layer { | |
bottom: "res2a_branch1" | |
bottom: "res2a_branch2b" | |
top: "res2a" | |
name: "res2a" | |
type: "Eltwise" | |
eltwise_param { | |
operation: MAX | |
} | |
} | |
########################## | |
######second shortcut##### | |
########################## | |
layer { | |
bottom: "res2a" | |
top: "res3a_branch1" | |
name: "res3a_branch1" | |
type: "Convolution" | |
convolution_param { | |
num_output: 64 | |
kernel_size: 1 | |
pad: 0 | |
stride: 2 | |
bias_term: false | |
weight_filler { | |
type: "gaussian" | |
std: 0.01 | |
} | |
bias_filler { | |
type: "constant" | |
} | |
} | |
} | |
layer { | |
bottom: "res2a" | |
top: "res3a_branch2a" | |
name: "res3a_branch2a" | |
type: "ReLU" | |
} | |
layer { | |
bottom: "res3a_branch2a" | |
top: "res3a_branch2b" | |
name: "res3a_branch2b" | |
type: "Convolution" | |
convolution_param { | |
num_output: 64 | |
kernel_size: 3 | |
pad: 1 | |
stride: 2 | |
bias_term: false | |
weight_filler { | |
type: "gaussian" | |
std: 0.01 | |
} | |
bias_filler { | |
type: "constant" | |
} | |
} | |
} | |
layer { | |
bottom: "res3a_branch1" | |
bottom: "res3a_branch2b" | |
top: "res3a" | |
name: "res3a" | |
type: "Eltwise" | |
eltwise_param { | |
operation: MAX | |
} | |
} | |
layer { | |
bottom: "res3a" | |
top: "pool5" | |
name: "pool5" | |
type: "Pooling" | |
pooling_param { | |
kernel_size: 3 | |
stride: 3 | |
pool: MAX | |
} | |
} | |
layer { | |
bottom: "pool5" | |
top: "fc1" | |
name: "fc1" | |
type: "InnerProduct" | |
inner_product_param { | |
num_output: 512 | |
weight_filler { | |
type: "gaussian" | |
std: 0.01 | |
} | |
bias_filler { | |
type: "constant" | |
} | |
} | |
} | |
layer{ | |
name: "slice6" | |
type: "Slice" | |
slice_param { | |
slice_dim: 1 | |
} | |
bottom: "fc1" | |
top: "slice1_1" | |
top: "slice1_2" | |
} | |
layer{ | |
name: "eltwise1" | |
type: "Eltwise" | |
bottom: "slice1_1" | |
bottom: "slice1_2" | |
top: "eltwise1" | |
eltwise_param { | |
operation: MAX | |
} | |
} | |
layer{ | |
name: "dropout1" | |
type: "Dropout" | |
bottom: "eltwise1" | |
top: "dropout1" | |
dropout_param { | |
dropout_ratio: 0.7 | |
} | |
} | |
layer { | |
bottom: "dropout1" | |
top: "fc7" | |
name: "fc7" | |
type: "InnerProduct" | |
inner_product_param { | |
num_output: 7906 | |
} | |
} | |
#layer { | |
# bottom: "fc7" | |
# top: "prob" | |
# name: "prob" | |
# type: "Softmax" | |
# } | |
layer { | |
name: "loss" | |
type: "SoftmaxWithLoss" | |
bottom: "fc7" | |
bottom: "label" | |
top: "loss" | |
} | |
layer { | |
name: "accuracy" | |
type: "Accuracy" | |
bottom: "fc7" | |
bottom: "label" | |
top: "accuracy" | |
include { | |
phase: TEST | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment