-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Adapting to the BatchNorm structure to support 3D data #3594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adapting to the BatchNorm structure to support 3D data #3594
Conversation
3cd0ec1
to
16bd861
Compare
959ed40
to
965bd40
Compare
@@ -16,4 +16,4 @@ | |||
|
|||
if __name__ == '__main__': | |||
parse_config_and_serialize( | |||
'trainer_config_helpers/tests/layers_test_config.py', '') | |||
'trainer_config_helpers/tests/configs/test_BatchNorm3D.py', '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change this line. Add test_BatchNorm3D.py
in the file python/paddle/trainer_config_helpers/tests/configs/file_list.sh
.
And please merge 3DConv/3DPooling first, then update this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
d1247d6
to
2c8b5d8
Compare
2c8b5d8
to
30c0df6
Compare
… Adapting_to_the_BatchNorm_structure_to_support_3D_data
proto/ModelConfig.proto
Outdated
@@ -515,7 +516,8 @@ message LayerConfig { | |||
// for HuberRegressionLoss | |||
optional double delta = 57 [ default = 1.0 ]; | |||
|
|||
optional uint64 depth = 58 [ default = 1 ]; | |||
// for 3D data | |||
optional double depth = 58 [ default = 1 ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use double?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, It has been fixed
9a93348
to
fe06096
Compare
fe06096
to
eaf23cb
Compare
…l_layers.protostr and new test_sub_nested_seq_select_layer.protostr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve this PR. If there is any problem, we can fix in the feature.
self.set_layer_size(input_layer.size) | ||
|
||
if len(self.inputs) > 1: | ||
assert len(self.inputs) == 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AddToLayer can support more than 2 inputs.
assert self.get_input_layer(0).width == self.get_input_layer( | ||
input_index).width | ||
assert self.get_input_layer(0).depth == self.get_input_layer( | ||
input_index).depth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
严格来说,对于Addto,我觉得只需要检测input_layer.size相等即可。
input_layer = self.get_input_layer(input_index) | ||
input = self.inputs[input_index] | ||
if self.config.size == 0: | ||
size += input_layer.size | ||
|
||
self.set_layer_height_width(self.get_input_layer(0).height, \ | ||
self.get_input_layer(0).width) | ||
self.set_layer_depth(self.get_input_layer(0).depth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
实际上不只Python这边需要对AddtoLayer ConcatLayer设置height width depth。C++的实现也需要set一下,这样才能支持变长输入。
* fix_install_docs * fix_install_docs2
fix #3597
Adapting to the BatchNorm structure to support 3D data