Created
March 30, 2018 18:01
-
-
Save sararob/4839f5b65e7076a090fed9efadb830be to your computer and use it in GitHub Desktop.
Defining a TensorFlow.js model, see this blog post for details: https://medium.com/tensorflow/introducing-tensorflow-js-machine-learning-in-javascript-bf3eab376db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as tf from ‘@tensorflow/tfjs’; | |
const model = tf.sequential(); | |
model.add(tf.layers.dense({inputShape: [4], units: 100})); | |
model.add(tf.layers.dense({units: 4})); | |
model.compile({loss: ‘categoricalCrossentropy’, optimizer: ‘sgd’}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment