-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Translate hrnn api daiwenkai #9920
Conversation
================================================ | ||
##################### | ||
|
||
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>`_\ 。 |
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.
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.
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.
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 \: |
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.
are -> is
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.
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. |
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.
lables -> labels
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.
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. |
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.
hightlight -> highlighted
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.
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. |
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.
Many layers in PaddlePaddle does not care -> Most layers in PaddlePaddle do not care
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.
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. |
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.
transforms -> transform
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.
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. |
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.
full-connected -> fully-connected
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.
Many thanks to your review~
modifications according to comments
fix #9015