example of seq2seq in tfjs

415 views
Skip to first unread message

Sohrab Saran

unread,
Jul 3, 2018, 7:11:41 AM7/3/18
to TensorFlow.js Discussion
Hi,
Can anyone please share an example of seq2seq in tfjs? For example, language translation.
Thanks,
Sohrab

yass...@google.com

unread,
Jul 3, 2018, 9:12:58 AM7/3/18
to TensorFlow.js Discussion

Sohrab Saran

unread,
Jul 3, 2018, 11:47:19 PM7/3/18
to TensorFlow.js Discussion
Hi Yannick,
Thanks for the link. One more question: is there any example of seq2seq training using tfjs? The link you provided says that the training was done in Python and Keras.

Shanqing Cai

unread,
Jul 5, 2018, 12:26:51 AM7/5/18
to TensorFlow.js Discussion
Hi Sohrab,

The AdditionRNN example (https://github.com/tensorflow/tfjs-examples/tree/master/addition-rnn) is precisely a seq2seq training example. The task is perhaps a little unconventional: given a sequence like "23+39", output a sequence like "62". But the essence of seq2seq is there.

Best,
Shanqing

Sohrab Saran

unread,
Jul 7, 2018, 7:12:57 AM7/7/18
to TensorFlow.js Discussion
Hi Shanqing,

Sorry if I am asking a silly question, but actually I'm a newbie to tensorflow:
When I run https://storage.googleapis.com/tfjs-examples/addition-rnn/dist/index.html I get all these fabulous graphs and parameters.
But what do these graphs and parameters mean?
How were the parameter default values arrived at?
Please point me to the documentation that can best answer this...

Question2: Also, I looked at the code of index.js in order to figure out how to provide my own training data.
I see a function 

generateData(digits, numExamples, invert) 


How do I change the code of this function to use an array of examples where each example is an array of 2 elements, the first element being an input string and second element being an output string,e.g.
[
["My name is Sohrab. What is my name?", "Sohrab"],
["My name is Shanquing. What is my name?", "Shanquing"] 
...
]

For my second question, I am analysing and experimenting with the code but meanwhile any pointer from your side will help.

Thanks,
Sohrab

Josiah Bryan

unread,
Sep 3, 2018, 12:30:20 AM9/3/18
to TensorFlow.js Discussion, sohra...@gmail.com
Hey @Sohrab, did you ever find any solutions? I'm looking for the same thing - training seq2seq with tfjs ....

Josiah Bryan

unread,
Sep 3, 2018, 1:11:49 PM9/3/18
to Sohrab Saran, TensorFlow.js Discussion
Appreciate the information! I have already done tons of background reading, looking for actual implementation haha. I look forward to seeing what you come up with!

On Mon, Sep 3, 2018, 1:09 PM Sohrab Saran <sohra...@gmail.com> wrote:
Hi Josiah,
I found this useful as background reading: 

Maybe I'll start doing that in a couple of days.

Best,
Sohrab

Z Z

unread,
Sep 22, 2018, 5:31:49 AM9/22/18
to TensorFlow.js Discussion, sohra...@gmail.com, josia...@gmail.com
Did anyone come up with an example of this ?
Reply all
Reply to author
Forward
0 new messages