You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tensorlayer/layers.py
+27-14Lines changed: 27 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -4864,10 +4864,12 @@ def __init__(
4864
4864
# Seq2seq
4865
4865
classSeq2Seq(Layer):
4866
4866
"""
4867
-
The :class:`Seq2Seq` class is a simple :class:`DynamicRNNLayer` based Seq2seq layer,
4868
-
both encoder and decoder are :class:`DynamicRNNLayer`, network details
4869
-
see `Model <https://camo.githubusercontent.com/242210d7d0151cae91107ee63bff364a860db5dd/687474703a2f2f6936342e74696e797069632e636f6d2f333031333674652e706e67>`_
4870
-
and `Sequence to Sequence Learning with Neural Networks <https://arxiv.org/abs/1409.3215>`_ .
4867
+
The :class:`Seq2Seq` class is a Simple :class:`DynamicRNNLayer` based Seq2seq layer without using `tl.contrib.seq2seq <https://www.tensorflow.org/api_guides/python/contrib.seq2seq>`_.
4868
+
See `Model <https://camo.githubusercontent.com/242210d7d0151cae91107ee63bff364a860db5dd/687474703a2f2f6936342e74696e797069632e636f6d2f333031333674652e706e67>`_
4869
+
and `Sequence to Sequence Learning with Neural Networks <https://arxiv.org/abs/1409.3215>`_.
4870
+
4871
+
- Please check the example `Twitter Chatbot <>`_.
4872
+
- The Author recommends users to read the source code of :class:`DynamicRNNLayer` and :class:`Seq2Seq`.
4871
4873
4872
4874
Parameters
4873
4875
----------
@@ -4904,9 +4906,23 @@ class Seq2Seq(Layer):
4904
4906
------------
4905
4907
outputs : a tensor
4906
4908
The output of RNN decoder.
4909
+
initial_state_encode : a tensor or StateTuple
4910
+
Initial state of RNN encoder.
4911
+
initial_state_decode : a tensor or StateTuple
4912
+
Initial state of RNN decoder.
4913
+
final_state_encode : a tensor or StateTuple
4914
+
Final state of RNN encoder.
4915
+
final_state_decode : a tensor or StateTuple
4916
+
Final state of RNN decoder.
4907
4917
4908
-
final_state : a tensor or StateTuple
4909
-
Final state of decoder, see :class:`DynamicRNNLayer` .
4918
+
Notes
4919
+
--------
4920
+
- How to feed data: `Sequence to Sequence Learning with Neural Networks <https://arxiv.org/pdf/1409.3215v3.pdf>`_
0 commit comments