-
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
Refine understand_sentiment_dynamic_lstm #7004
Conversation
|
||
inputs = [fc1, lstm1] | ||
|
||
for i in range(2, stacked_num + 1): | ||
fc = fluid.layers.fc(input=inputs, size=hid_dim) | ||
fc = fluid.layers.fc(input=inputs, |
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.
Please format these lines
emb = fluid.layers.embedding( | ||
input=data, | ||
size=[input_dim, emb_dim], | ||
param_attr=ParamAttr(initializer=NormalInitializer( |
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.
loc default value is .0.
|
||
fc1 = fluid.layers.fc(input=emb, | ||
size=hid_dim, | ||
bias_attr=ParamAttr(initializer=NormalInitializer( |
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.
Create a ParamAttr, and share it between layers.
input=fc1, | ||
size=hid_dim, | ||
candidate_activation='relu', | ||
bias_attr=ParamAttr(initializer=NormalInitializer( |
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.
Same above
size=hid_dim, | ||
is_reverse=(i % 2) == 0, | ||
candidate_activation='relu', | ||
bias_attr=ParamAttr(initializer=NormalInitializer( |
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.
Same
prediction = fluid.layers.fc( | ||
input=[fc_last, lstm_last], | ||
size=class_dim, | ||
bias_attr=ParamAttr(initializer=NormalInitializer( |
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.
And these lines.
#7003