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

Refine understand_sentiment_dynamic_lstm #7004

Closed
wants to merge 1 commit into from
Closed

Refine understand_sentiment_dynamic_lstm #7004

wants to merge 1 commit into from

Conversation

ranqiu92
Copy link
Contributor


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,
Copy link
Contributor

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(
Copy link
Contributor

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(
Copy link
Contributor

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(
Copy link
Contributor

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(
Copy link
Contributor

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(
Copy link
Contributor

Choose a reason for hiding this comment

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

And these lines.

@ranqiu92 ranqiu92 closed this Mar 8, 2018
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

2 participants