-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
add configuration helper for prelu layer. #2412
Conversation
b0061b7
to
c7483bf
Compare
assert len(input) == 1, 'prelu_layer only accepts one input' | ||
else: | ||
input = [input] | ||
assert isinstance(input[0], LayerOutput) |
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.
只支持一个输入的,可以删掉5598-5601行,写成:
assert isinstance(input, LayerOutput)
'it requires only one parameter setting.') | ||
else: | ||
param_attr = [param_attr] | ||
assert isinstance(param_attr[0], ParameterAttribute) |
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.
同样, 去掉5604-5609行,只保留:
assert isinstance(param_attr, ParameterAttribute)
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
l = Layer( | ||
name=name, | ||
type='prelu', | ||
inputs=Input(input[0].name, **param_attr[0].attr), |
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.
这里写成:
inputs=Input(input.name, **param_attr.attr),
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
doc/api/v2/config/layer.rst
Outdated
============ | ||
|
||
eos | ||
--- | ||
.. autoclass:: paddle.v2.layer.eos | ||
:noindex: | ||
|
||
Activation with learnable parameter | ||
=================== |
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.
== 加长到和445行对齐或更长,不然编译doc可能出warning
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
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.
follow comments.
doc/api/v2/config/layer.rst
Outdated
============ | ||
|
||
eos | ||
--- | ||
.. autoclass:: paddle.v2.layer.eos | ||
:noindex: | ||
|
||
Activation with learnable parameter | ||
=================== |
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
'it requires only one parameter setting.') | ||
else: | ||
param_attr = [param_attr] | ||
assert isinstance(param_attr[0], ParameterAttribute) |
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
l = Layer( | ||
name=name, | ||
type='prelu', | ||
inputs=Input(input[0].name, **param_attr[0].attr), |
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
* refine trainer
fix prelu api #2405