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

add configuration helper for prelu layer. #2412

Merged
merged 3 commits into from
Jun 8, 2017

Conversation

lcy-seso
Copy link
Contributor

@lcy-seso lcy-seso commented Jun 7, 2017

  1. add configuration helper for prelu layer.
  2. fix bugs of prelu in config_parser.py
    fix prelu api #2405

@lcy-seso lcy-seso requested a review from qingqing01 June 7, 2017 13:04
@lcy-seso lcy-seso mentioned this pull request Jun 7, 2017
@lcy-seso lcy-seso force-pushed the add_config_helper_for_prelu branch from b0061b7 to c7483bf Compare June 8, 2017 02:09
assert len(input) == 1, 'prelu_layer only accepts one input'
else:
input = [input]
assert isinstance(input[0], LayerOutput)
Copy link
Contributor

Choose a reason for hiding this comment

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

只支持一个输入的,可以删掉5598-5601行,写成:

 assert isinstance(input, LayerOutput)

'it requires only one parameter setting.')
else:
param_attr = [param_attr]
assert isinstance(param_attr[0], ParameterAttribute)
Copy link
Contributor

Choose a reason for hiding this comment

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

同样, 去掉5604-5609行,只保留:

assert isinstance(param_attr, ParameterAttribute)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

l = Layer(
name=name,
type='prelu',
inputs=Input(input[0].name, **param_attr[0].attr),
Copy link
Contributor

Choose a reason for hiding this comment

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

这里写成:

inputs=Input(input.name, **param_attr.attr),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

============

eos
---
.. autoclass:: paddle.v2.layer.eos
:noindex:

Activation with learnable parameter
===================
Copy link
Contributor

Choose a reason for hiding this comment

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

== 加长到和445行对齐或更长,不然编译doc可能出warning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

@lcy-seso lcy-seso left a comment

Choose a reason for hiding this comment

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

follow comments.

============

eos
---
.. autoclass:: paddle.v2.layer.eos
:noindex:

Activation with learnable parameter
===================
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

'it requires only one parameter setting.')
else:
param_attr = [param_attr]
assert isinstance(param_attr[0], ParameterAttribute)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

l = Layer(
name=name,
type='prelu',
inputs=Input(input[0].name, **param_attr[0].attr),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@lcy-seso lcy-seso merged commit a3123e2 into PaddlePaddle:develop Jun 8, 2017
@lcy-seso lcy-seso deleted the add_config_helper_for_prelu branch June 29, 2017 09:31
heavengate added a commit to heavengate/Paddle that referenced this pull request Aug 16, 2021
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.

prelu api
2 participants