- Notifications
You must be signed in to change notification settings - Fork 5.9k
add new API paddle.nn.initializer.Orthogonal and calculate_gain #37163
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
Conversation
| Thanks for your contribution! |
8ade9f2 to 74c368e Compare 74c368e to 7937e1b Compare 7937e1b to c6a8bd2 Compare | param = 0.01 | ||
| else: | ||
| assert isinstance(param, (bool, int, float)) | ||
| recommended_gain = { |
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.
shall we support calculate gain of selu?
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
| | ||
| | ||
| class TestConstantInitializer(unittest.TestCase): | ||
| def test_calculate_gain(self): |
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.
shall we add test case of relu and selu?
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, thx
f03e982 to bc959ac Compare
jeff41404 left a comment
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
XiaoguangHu01 left a comment
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.
LG API
python/paddle/fluid/initializer.py Outdated
| Args: | ||
| nonlinearity: nonlinearity function. | ||
| param: optional parameter for somme nonlinearity function |
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.
param(type, optional);
default is None, means xxx
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, thx
python/paddle/fluid/initializer.py Outdated
| import paddle | ||
| gain = paddle.nn.initializer.calculate_gain('tanh') | ||
| initializer = paddle.nn.initializer.Orthogonal(gain) |
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.
最好能以注释给一下运行的结果
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
6045fdc 6045fdc to 9721672 Compare
TCChenlong left a comment
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 for API Docs
9721672 to e1c11e3 Compare e1c11e3 to 06cfcdf Compare
TCChenlong left a comment
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 for API docs
XiaoguangHu01 left a comment
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.
LG API
PR types
New features
PR changes
APIs
Describe
paddle.nn.initializer.Orthogonal
paddle.nn.initializer.calculate_gain