Skip to content

Instantly share code, notes, and snippets.

@sld

sld/README.md Secret

Last active March 19, 2017 06:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sld/6ecd597d455b62ef5d36 to your computer and use it in GitHub Desktop.
Save sld/6ecd597d455b62ef5d36 to your computer and use it in GitHub Desktop.
SVHN by Caffe
name: "WinnySvhnTrainTest"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 32
input_dim: 32
layers {
bottom: "data"
top: "conv1/5x5_s1"
name: "conv1/5x5_s1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 64
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
std: 0.0001
}
}
}
layers {
bottom: "conv1/5x5_s1"
top: "conv1/5x5_s1"
name: "conv1/relu_5x5"
type: RELU
}
layers {
bottom: "conv1/5x5_s1"
top: "pool1/3x3_s2"
name: "pool1/3x3_s2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
bottom: "pool1/3x3_s2"
top: "conv2/5x5_s1"
name: "conv2/5x5_s1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 64
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
std: 0.01
}
}
}
layers {
bottom: "conv2/5x5_s1"
top: "conv2/5x5_s1"
name: "conv2/relu_5x5"
type: RELU
}
layers {
bottom: "conv2/5x5_s1"
top: "pool2/3x3_s2"
name: "pool2/3x3_s2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
bottom: "pool2/3x3_s2"
top: "conv3/5x5_s1"
name: "conv3/5x5_s1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 128
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
std: 0.01
}
}
}
layers {
bottom: "conv3/5x5_s1"
top: "conv3/5x5_s1"
name: "conv3/relu_5x5"
type: RELU
}
layers {
bottom: "conv3/5x5_s1"
top: "pool3/3x3_s2"
name: "pool3/3x3_s2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
bottom: "pool3/3x3_s2"
top: "ip1/3072"
name: "ip1/3072"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 3072
weight_filler {
type: "gaussian"
std: 0.001
}
bias_filler {
type: "constant"
}
}
}
layers {
bottom: "ip1/3072"
top: "ip1/3072"
name: "ip1/relu_5x5"
type: RELU
}
layers {
bottom: "ip1/3072"
top: "ip2/2048"
name: "ip2/2048"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 2048
weight_filler {
type: "xavier"
std: 0.001
}
bias_filler {
type: "constant"
}
}
}
layers {
bottom: "ip2/2048"
top: "ip2/2048"
name: "ip2/relu_5x5"
type: RELU
}
layers {
bottom: "ip2/2048"
top: "ip3/10"
name: "ip3/10"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 10
weight_filler {
type: "xavier"
std: 0.1
}
}
}
layers {
name: "prob"
type: SOFTMAX
bottom: "ip3/10"
top: "prob"
}
net: "/home/deploy/opt/SVHN/svhn/winny-f/winny_f_svhn.prototxt"
test_iter: 1
test_interval: 700
base_lr: 0.01
momentum: 0.9
weight_decay: 0.004
lr_policy: "inv"
gamma: 0.0001
power: 0.75
solver_type: NESTEROV
display: 100
max_iter: 77000
snapshot: 700
snapshot_prefix: "/mnt/home/deploy/opt/SVHN/svhn/snapshots/winny_net/winny-F"
solver_mode: GPU
name: "WinnyNet-F"
layers {
name: "svhn-rgb"
type: IMAGE_DATA
top: "data"
top: "label"
image_data_param {
source: "/home/deploy/opt/SVHN/train-rgb-b.txt"
batch_size: 128
shuffle: true
}
transform_param {
mean_file: "/home/deploy/opt/SVHN/svhn/winny_net5/mean.binaryproto"
}
include: { phase: TRAIN }
}
layers {
name: "svhn-rgb"
type: IMAGE_DATA
top: "data"
top: "label"
image_data_param {
source: "/home/deploy/opt/SVHN/test-rgb-b.txt"
batch_size: 120
}
transform_param {
mean_file: "/home/deploy/opt/SVHN/svhn/winny_net5/mean.binaryproto"
}
include: { phase: TEST }
}
layers {
bottom: "data"
top: "conv1/5x5_s1"
name: "conv1/5x5_s1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 64
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
std: 0.0001
}
}
}
layers {
bottom: "conv1/5x5_s1"
top: "conv1/5x5_s1"
name: "conv1/relu_5x5"
type: RELU
}
layers {
bottom: "conv1/5x5_s1"
top: "pool1/3x3_s2"
name: "pool1/3x3_s2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
bottom: "pool1/3x3_s2"
top: "conv2/5x5_s1"
name: "conv2/5x5_s1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 64
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
std: 0.01
}
}
}
layers {
bottom: "conv2/5x5_s1"
top: "conv2/5x5_s1"
name: "conv2/relu_5x5"
type: RELU
}
layers {
bottom: "conv2/5x5_s1"
top: "pool2/3x3_s2"
name: "pool2/3x3_s2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
bottom: "pool2/3x3_s2"
top: "conv3/5x5_s1"
name: "conv3/5x5_s1"
type: CONVOLUTION
blobs_lr: 1
blobs_lr: 2
convolution_param {
num_output: 128
kernel_size: 5
stride: 1
pad: 2
weight_filler {
type: "xavier"
std: 0.01
}
}
}
layers {
bottom: "conv3/5x5_s1"
top: "conv3/5x5_s1"
name: "conv3/relu_5x5"
type: RELU
}
layers {
bottom: "conv3/5x5_s1"
top: "pool3/3x3_s2"
name: "pool3/3x3_s2"
type: POOLING
pooling_param {
pool: MAX
kernel_size: 3
stride: 2
}
}
layers {
bottom: "pool3/3x3_s2"
top: "ip1/3072"
name: "ip1/3072"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 3072
weight_filler {
type: "gaussian"
std: 0.001
}
bias_filler {
type: "constant"
}
}
}
layers {
bottom: "ip1/3072"
top: "ip1/3072"
name: "ip1/relu_5x5"
type: RELU
}
layers {
bottom: "ip1/3072"
top: "ip2/2048"
name: "ip2/2048"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 2048
weight_filler {
type: "xavier"
std: 0.001
}
bias_filler {
type: "constant"
}
}
}
layers {
bottom: "ip2/2048"
top: "ip2/2048"
name: "ip2/relu_5x5"
type: RELU
}
layers {
bottom: "ip2/2048"
top: "ip3/10"
name: "ip3/10"
type: INNER_PRODUCT
blobs_lr: 1
blobs_lr: 2
inner_product_param {
num_output: 10
weight_filler {
type: "xavier"
std: 0.1
}
}
}
layers {
name: "accuracy"
type: ACCURACY
bottom: "ip3/10"
bottom: "label"
top: "accuracy"
include: { phase: TEST }
}
layers {
name: "loss"
type: SOFTMAX_LOSS
bottom: "ip3/10"
bottom: "label"
top: "loss"
}
@codemukul95
Copy link

Hey could you add your code how did you use data from mat file for Caffe model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment