Skip to content

Commit

Permalink
Merge pull request BVLC#1039 from sergeyk/dev
Browse files Browse the repository at this point in the history
[example] HDF5 classification
  • Loading branch information
shelhamer committed Sep 5, 2014
2 parents b5c5f30 + 43d8a75 commit eef7e81
Show file tree
Hide file tree
Showing 5 changed files with 1,119 additions and 0 deletions.
946 changes: 946 additions & 0 deletions examples/hdf5_classification.ipynb

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions examples/hdf5_classification/solver.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
net: "examples/hdf5_classification/train_val.prototxt"
test_iter: 1000
test_interval: 1000
base_lr: 0.01
lr_policy: "step"
gamma: 0.1
stepsize: 5000
display: 1000
max_iter: 10000
momentum: 0.9
weight_decay: 0.0005
snapshot: 10000
snapshot_prefix: "examples/hdf5_classification/data/train"
solver_mode: CPU
14 changes: 14 additions & 0 deletions examples/hdf5_classification/solver2.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
net: "examples/hdf5_classification/train_val2.prototxt"
test_iter: 1000
test_interval: 1000
base_lr: 0.01
lr_policy: "step"
gamma: 0.1
stepsize: 5000
display: 1000
max_iter: 10000
momentum: 0.9
weight_decay: 0.0005
snapshot: 10000
snapshot_prefix: "examples/hdf5_classification/data/train"
solver_mode: CPU
59 changes: 59 additions & 0 deletions examples/hdf5_classification/train_val.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "LogisticRegressionNet"
layers {
name: "data"
type: HDF5_DATA
top: "data"
top: "label"
hdf5_data_param {
source: "examples/hdf5_classification/data/train.txt"
batch_size: 10
}
include: { phase: TRAIN }
}
layers {
name: "data"
type: HDF5_DATA
top: "data"
top: "label"
hdf5_data_param {
source: "examples/hdf5_classification/data/test.txt"
batch_size: 10
}
include: { phase: TEST }
}
layers {
name: "fc1"
type: INNER_PRODUCT
bottom: "data"
top: "fc1"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "loss"
type: SOFTMAX_LOSS
bottom: "fc1"
bottom: "label"
top: "loss"
}
layers {
name: "accuracy"
type: ACCURACY
bottom: "fc1"
bottom: "label"
top: "accuracy"
include: { phase: TEST }
}
86 changes: 86 additions & 0 deletions examples/hdf5_classification/train_val2.prototxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "LogisticRegressionNet"
layers {
name: "data"
type: HDF5_DATA
top: "data"
top: "label"
hdf5_data_param {
source: "examples/hdf5_classification/data/train.txt"
batch_size: 10
}
include: { phase: TRAIN }
}
layers {
name: "data"
type: HDF5_DATA
top: "data"
top: "label"
hdf5_data_param {
source: "examples/hdf5_classification/data/test.txt"
batch_size: 10
}
include: { phase: TEST }
}
layers {
name: "fc1"
type: INNER_PRODUCT
bottom: "data"
top: "fc1"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 40
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "relu1"
type: RELU
bottom: "fc1"
top: "fc1"
}
layers {
name: "fc2"
type: INNER_PRODUCT
bottom: "fc1"
top: "fc2"
blobs_lr: 1
blobs_lr: 2
weight_decay: 1
weight_decay: 0
inner_product_param {
num_output: 2
weight_filler {
type: "gaussian"
std: 0.01
}
bias_filler {
type: "constant"
value: 0
}
}
}
layers {
name: "loss"
type: SOFTMAX_LOSS
bottom: "fc2"
bottom: "label"
top: "loss"
}
layers {
name: "accuracy"
type: ACCURACY
bottom: "fc2"
bottom: "label"
top: "accuracy"
include: { phase: TEST }
}

0 comments on commit eef7e81

Please sign in to comment.