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

Translate hrnn api daiwenkai #9920

Merged
merged 5 commits into from
Apr 18, 2018

Conversation

daiwk
Copy link
Contributor

@daiwk daiwk commented Apr 14, 2018

fix #9015

@CLAassistant
Copy link

CLAassistant commented Apr 14, 2018

CLA assistant check
All committers have signed the CLA.

================================================
#####################

This article takes PaddlePaddle's hierarchical RNN unit test as an example. We will use multiple pairs of seperately uses of single-layer and hierarchical RNNs as the network configuration that have same effects to explain how to use hierarchical RNNs. All of the examples in this article only describe the API interface of the hierarchical RNN, while we do not use this hierarchical RNN to solve practical problems. If you want to understand the use of hierarchical RNN in specific issues, please refer to \ :ref:`algo_hrnn_demo`\ 。The unit test file used in this article's example is \ `test_RecurrentGradientMachine.cpp <https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/gserver/tests/test_RecurrentGradientMachine.cpp>`_\ 。
Copy link
Contributor

Choose a reason for hiding this comment

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

This sentence does not make much sense. I m not sure what you are trying to say.
We will use multiple pairs of seperately uses of single-layer and hierarchical RNNs as the network configuration that have same effects to explain how to use hierarchical RNNs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed this sentence to

We will use several examples to illestrate the usage of single-layer and hierarchical RNNs. Each example has two model configurations, one for single-layer, and the other for hierarchical RNN. Although the implementations are different, both the two model configurations' effects are the same.

Many thanks to your review~

Reading hierarchical sequence data
----------------

Firstly, the original data in this example are as follows \:
Copy link
Contributor

Choose a reason for hiding this comment

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

are -> is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Many thanks to your review~


- As for the same data, the DataProvider code for hierarchical time series. Its description is as follows:

- DataProvider returns two lists of data, that are "sentences" and "lables", corresponding to the sentences and lables in each group in the original data of hierarchical time series.
Copy link
Contributor

Choose a reason for hiding this comment

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

lables -> labels

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Many thanks to your review~

Model configuration
------------------------------------------

Firstly, let's look at the configuration of single-layer RNN. The hightlight part of line 9 to line 15 is the usage of single-layer RNN. Here we use the pre-defined RNN process function in PaddlePaddle. In this function, for each time step, RNN passes through an LSTM network.
Copy link
Contributor

Choose a reason for hiding this comment

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

hightlight -> highlighted

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Many thanks to your review~


Secondly, let's look at the model configuration of hierarchical RNN which has the same semantic meaning. \:

* Many layers in PaddlePaddle does not care about whether the input is time series or not, e.g. \ :code:`embedding_layer`\ . In these layers, every operation is processed on each time step.
Copy link
Contributor

Choose a reason for hiding this comment

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

Many layers in PaddlePaddle does not care -> Most layers in PaddlePaddle do not care

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Many thanks to your review~


* Many layers in PaddlePaddle does not care about whether the input is time series or not, e.g. \ :code:`embedding_layer`\ . In these layers, every operation is processed on each time step.

* In the hightlight part of line 7 to line 26 of this configuration, we transforms the hierarchical time series data into single-layer time series data, then process each single-layer time series.
Copy link
Contributor

Choose a reason for hiding this comment

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

transforms -> transform

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Many thanks to your review~

Example 2:Hierarchical RNN with Memory between subsequences
================================

This example is intended to implement two fully-equivalent full-connected RNNs using single-layer RNN and hierarchical RNN.
Copy link
Contributor

Choose a reason for hiding this comment

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

full-connected -> fully-connected

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.
Many thanks to your review~

modifications according to comments
@abhinavarora abhinavarora merged commit 777cb55 into PaddlePaddle:develop Apr 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Translation Plan-单双层RNN API对比介绍-汉译英
4 participants