-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Fix conv2d bias #5651
Fix conv2d bias #5651
Conversation
emailweixu
commented
Nov 15, 2017
- The size of the bias parameter should be the number of filters. Changed LayerHelper.append_bias_op to allow this kind of bias.
- Also change the default initialization of bias to be constant zero
- Added a helper to get the value of a parameter.
- Updated test_parameter
The size of the bias parameter should be the number of filters.
python/paddle/v2/fluid/layers.py
Outdated
@@ -676,6 +676,7 @@ def conv2d(input, | |||
filter_shape = [num_filters, num_filter_channels] + filter_size | |||
|
|||
std = (2.0 / (filter_size[0]**2 * num_channels))**0.5 | |||
print 'name=', name, 'std=', std |
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.
this debug code should be removed
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.
fixed.
python/paddle/v2/fluid/io.py
Outdated
if program is None: | ||
program = g_main_program | ||
var = program.global_block().var(name) | ||
assert is_parameter(var) |
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.
should move this assert into get_parameter_value
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.
fixed
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.
LGTM!
0ff1d26
to
d8bf343
Compare
d8bf343
to
81bb26f
Compare
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.
LGTM
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.
LGTM++.