Skip to content

Commit

Permalink
Use diff to compare config unittest (#363)
Browse files Browse the repository at this point in the history
Fix #342
  • Loading branch information
wen-bo-yang authored and reyoung committed Nov 7, 2016
1 parent 93e4d0c commit c64cd6f
Show file tree
Hide file tree
Showing 26 changed files with 4,371 additions and 25 deletions.
23 changes: 0 additions & 23 deletions python/paddle/trainer_config_helpers/tests/configs/check.md5

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e
cd `dirname $0`
export PYTHONPATH=$PWD/../../../../

protostr=$PWD/protostr

configs=(test_fc layer_activations projections test_print_layer
test_sequence_pooling test_lstmemory_layer test_grumemory_layer
last_first_seq test_expand_layer test_ntm_layers test_hsigmoid
Expand All @@ -15,5 +17,5 @@ test_maxout test_bi_grumemory math_ops)
for conf in ${configs[*]}
do
echo "Generating " $conf
python -m paddle.utils.dump_config $conf.py > $conf.protostr
python -m paddle.utils.dump_config $conf.py > $protostr/$conf.protostr.unitest
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
type: "nn"
layers {
name: "image"
type: "data"
size: 65536
active_type: ""
}
layers {
name: "__conv_0__"
type: "exconv"
size: 3297856
active_type: ""
inputs {
input_layer_name: "image"
input_parameter_name: "___conv_0__.w0"
conv_conf {
filter_size: 32
channels: 1
stride: 1
padding: 1
groups: 1
filter_channels: 1
output_x: 227
img_size: 256
caffe_mode: true
filter_size_y: 32
padding_y: 1
stride_y: 1
}
}
bias_parameter_name: "___conv_0__.wbias"
num_filters: 64
shared_biases: true
}
layers {
name: "__batch_norm_0__"
type: "batch_norm"
size: 3297856
active_type: "relu"
inputs {
input_layer_name: "__conv_0__"
input_parameter_name: "___batch_norm_0__.w0"
image_conf {
channels: 64
img_size: 227
}
}
inputs {
input_layer_name: "__conv_0__"
input_parameter_name: "___batch_norm_0__.w1"
}
inputs {
input_layer_name: "__conv_0__"
input_parameter_name: "___batch_norm_0__.w2"
}
bias_parameter_name: "___batch_norm_0__.wbias"
moving_average_fraction: 0.9
}
layers {
name: "__crmnorm_0__"
type: "norm"
size: 3297856
active_type: ""
inputs {
input_layer_name: "__batch_norm_0__"
norm_conf {
norm_type: "cmrnorm-projection"
channels: 64
size: 32
scale: 0.0004
pow: 0.75
output_x: 227
img_size: 227
blocked: false
}
}
}
layers {
name: "__pool_0__"
type: "pool"
size: 2458624
active_type: ""
inputs {
input_layer_name: "__conv_0__"
pool_conf {
pool_type: "max-projection"
channels: 64
size_x: 32
stride: 1
output_x: 196
img_size: 227
padding: 0
size_y: 32
stride_y: 1
output_y: 196
img_size_y: 227
padding_y: 0
}
}
}
parameters {
name: "___conv_0__.w0"
size: 65536
initial_mean: 0.0
initial_std: 0.0441941738242
initial_strategy: 0
initial_smart: false
}
parameters {
name: "___conv_0__.wbias"
size: 64
initial_mean: 0.0
initial_std: 0.0
dims: 64
dims: 1
initial_strategy: 0
initial_smart: false
}
parameters {
name: "___batch_norm_0__.w0"
size: 64
initial_mean: 1.0
initial_std: 0.0
initial_strategy: 0
initial_smart: false
}
parameters {
name: "___batch_norm_0__.w1"
size: 64
initial_mean: 0.0
initial_std: 0.0
dims: 1
dims: 64
initial_strategy: 0
initial_smart: false
is_static: true
is_shared: true
}
parameters {
name: "___batch_norm_0__.w2"
size: 64
initial_mean: 0.0
initial_std: 0.0
dims: 1
dims: 64
initial_strategy: 0
initial_smart: false
is_static: true
is_shared: true
}
parameters {
name: "___batch_norm_0__.wbias"
size: 64
initial_mean: 0.0
initial_std: 0.0
dims: 1
dims: 64
initial_strategy: 0
initial_smart: false
}
input_layer_names: "image"
output_layer_names: "__pool_0__"
output_layer_names: "__crmnorm_0__"
sub_models {
name: "root"
layer_names: "image"
layer_names: "__conv_0__"
layer_names: "__batch_norm_0__"
layer_names: "__crmnorm_0__"
layer_names: "__pool_0__"
input_layer_names: "image"
output_layer_names: "__pool_0__"
output_layer_names: "__crmnorm_0__"
is_recurrent_layer_group: false
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
type: "nn"
layers {
name: "data"
type: "data"
size: 30
active_type: ""
}
layers {
name: "__first_seq_0__"
type: "seqlastins"
size: 30
active_type: "linear"
inputs {
input_layer_name: "data"
}
select_first: true
trans_type: "seq"
}
layers {
name: "__first_seq_1__"
type: "seqlastins"
size: 30
active_type: "linear"
inputs {
input_layer_name: "data"
}
select_first: true
trans_type: "non-seq"
}
layers {
name: "__last_seq_0__"
type: "seqlastins"
size: 30
active_type: "linear"
inputs {
input_layer_name: "data"
}
trans_type: "seq"
}
layers {
name: "__last_seq_1__"
type: "seqlastins"
size: 30
active_type: "linear"
inputs {
input_layer_name: "data"
}
trans_type: "non-seq"
}
input_layer_names: "data"
output_layer_names: "__first_seq_0__"
output_layer_names: "__first_seq_1__"
output_layer_names: "__last_seq_0__"
output_layer_names: "__last_seq_1__"
sub_models {
name: "root"
layer_names: "data"
layer_names: "__first_seq_0__"
layer_names: "__first_seq_1__"
layer_names: "__last_seq_0__"
layer_names: "__last_seq_1__"
input_layer_names: "data"
output_layer_names: "__first_seq_0__"
output_layer_names: "__first_seq_1__"
output_layer_names: "__last_seq_0__"
output_layer_names: "__last_seq_1__"
is_recurrent_layer_group: false
}

Loading

0 comments on commit c64cd6f

Please sign in to comment.