Skip to content
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

Merged
merged 2 commits into from
Nov 15, 2017
Merged

Fix conv2d bias #5651

merged 2 commits into from
Nov 15, 2017

Conversation

emailweixu
Copy link
Collaborator

  1. The size of the bias parameter should be the number of filters. Changed LayerHelper.append_bias_op to allow this kind of bias.
  2. Also change the default initialization of bias to be constant zero
  3. Added a helper to get the value of a parameter.
  4. Updated test_parameter

The size of the bias parameter should be the number of filters.
@@ -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
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

if program is None:
program = g_main_program
var = program.global_block().var(name)
assert is_parameter(var)
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

jacquesqiao
jacquesqiao previously approved these changes Nov 15, 2017
Copy link
Member

@jacquesqiao jacquesqiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@jacquesqiao jacquesqiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@qingqing01 qingqing01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM++.

@qingqing01 qingqing01 merged commit f95c291 into PaddlePaddle:develop Nov 15, 2017
@emailweixu emailweixu deleted the fix_conv_bias branch March 16, 2018 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants