I am looking for the Version of Tensorflow Playground with TensorflowJS or TFJS

34 views
Skip to first unread message

Jaffer Wilson

unread,
Jan 3, 2019, 2:49:11 AM1/3/19
to TensorFlow.js Discussion
I am looking for the tfjs or tensorflowjs based version of the nn.ts file. But I am not getting anything related to it or not even the issues/feature section is not working as no one replies there.
Here is the link of the original file:  
I want to know how I can convert is with the Tensorflowjs to get the similar functionality.
Please help me. If someone had already done with tfjs please share. Else advise me what i can do.
I am stuck with this part please help me.

Nikhil Thorat

unread,
Jan 3, 2019, 3:50:33 PM1/3/19
to Jaffer Wilson, TensorFlow.js Discussion
Sent a comment on SO.

The TensorFlow playground model is just a stack of fully connected layers with some non-linearities that the user can define, performing a regression task. The code is not vectorized, so it wouldn't make much sense to repurpose any of the code.

A simple fully connected model with regression in TensorFlow.js looks like this:


const model = tf.sequential();

model.add(tf.layers.dense({units: 10, inputShape: [10], activation: 'relu'}));
model.add(tf.layers.dense({units: 10}));

model.compile({optimizer: 'sgd', loss: 'meanSquaredError'});

await model.fit(xs, ys, {
batchSize: 4,
epochs: 3
});

If this code is a little foreign, I suggest you try to go through some of the introductory machine learning concepts that we link from the homepage to get yourself familiar with ML & the API.

--
You received this message because you are subscribed to the Google Groups "TensorFlow.js Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tfjs+uns...@tensorflow.org.
Visit this group at https://groups.google.com/a/tensorflow.org/group/tfjs/.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tfjs/dffd65c1-c03c-4050-9ba5-e9fcdc14667f%40tensorflow.org.

Jaffer Wilson

unread,
Jan 4, 2019, 1:24:04 AM1/4/19
to TensorFlow.js Discussion, jaffer...@gmail.com
Appreciate your reply Nikhil. Thank you.
But if that is the reality why not you have edited the Playground with it and showed the world the real power of Tensorflow js instead of just using a toy neural network?
I guess there are certain flaws which might come forward if it gets included. Am I right? The functionality what the playground now offers will be obstructed.
Please let me know if that is the case I won't put my time learning it. I have experience with Tensorflow in Python. Javascript, it won't take much time for me to learn but if it is not capable of giving me the result as the current Playground is capable of then it is not worth.
Please enlighten me.

Jaffer Wilson

unread,
Jan 4, 2019, 1:56:13 AM1/4/19
to TensorFlow.js Discussion, jaffer...@gmail.com
Dear Nikil, Can I share with you the code that I have tried. I have little understanding of the Javascript, but it still worked for me. But I am not satisfied as the neural network is a toy  one and not tfjs. Can you help?


On Friday, January 4, 2019 at 2:20:33 AM UTC+5:30, Nikhil Thorat wrote:

Jaffer Wilson

unread,
Jan 4, 2019, 2:04:14 AM1/4/19
to TensorFlow.js Discussion, jaffer...@gmail.com
actually, I wanted to have a similar experience of weight and bias modification and etc with the tfjs. But I could not see. I have watch a video that was shown in one of the blog of Google Cloud. Here is the partial video link, the part that fascinates me: https://youtu.be/BwWg__HVfsM?t=498
I wanted to have the similar sort of stuff. Is it doable? Please help me I am stuck at what I am doing. Please its a request.

Nikhil Thorat

unread,
Jan 4, 2019, 10:14:55 AM1/4/19
to Jaffer Wilson, TensorFlow.js Discussion
TensorFlow.js was actually born out of a for of TensorFlow playground. We haven't back ported it just because of time, to be honest. It would pretty much be an invisible change, an in fact we'd have to slow down the neural network so you could see it evolve.

You should absolutely be able to get the same effect as the TensorFlow playground, the training dynamics should not be different, you should only see speed wins. If it doesn't work because of a bug, then maybe try to track down specifically the issue and we can try to fix it.

Reply all
Reply to author
Forward
0 new messages