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

Init commit for DynRNN understand sentiment #30

Merged
merged 5 commits into from
Jan 8, 2018

Conversation

reyoung
Copy link
Contributor

@reyoung reyoung commented Dec 22, 2017

Dynamic RNN 情感分类

	总C++时间 16.64s
	* WhileOp 前向时间 -- 3.63s
		* 构造Op时间 0.63s
		* 构造Tensor时间 0.08s
		* 析构Op时间 0.27s
		* Op运行时间 2.16s
			InferShape时间 0.83
				* CompareOp::InferShape 0.04s
				* MulOp::InferShape 0.36s
					* String构造 0.08s
				* Activation::InferShape 0.05s
				* ElemwiseOp::InferShape 0.23s
				* SumOp::InferShape 0.15s
	* WhileOp  反向时间 -- 8.90s
		* 构造Op时间 0.72s
		* 析构Op时间 0.44s

	* 析构子Scope时间 -- 1.72s

rnn.output(hidden)

last = fluid.layers.sequence_pool(rnn(), 'last')
logit = fluid.layers.fc(input=last, size=2, act='softmax')
Copy link
Owner

Choose a reason for hiding this comment

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

We obey the convention that split model out of data pipeline,
just like https://github.com/dzhwinter/benchmark/blob/master/fluid/resnet.py#L75 .

cPickle.dump(word_dict, f, cPickle.HIGHEST_PROTOCOL)


def cache_reader(reader, clean):
Copy link
Owner

Choose a reason for hiding this comment

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

We do not have a unified way to accelerate our benchmark demos. I doubt about the reasonability of caching the dataset with CPickle when do benchmark.

@@ -0,0 +1,193 @@
import argparse
Copy link
Owner

Choose a reason for hiding this comment

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

We have a old one understand_sentiment_dynamic_rnn.py, I think we can delete that one and replace with this one?

Copy link
Owner

@dzhwinter dzhwinter left a comment

Choose a reason for hiding this comment

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

We can merge this PR and refine the io part style same with other scripts

@dzhwinter dzhwinter merged commit dde94f9 into dzhwinter:master Jan 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