Skip to content

Instantly share code, notes, and snippets.

@sararob
Created March 30, 2018 18:01
Show Gist options
  • Save sararob/4839f5b65e7076a090fed9efadb830be to your computer and use it in GitHub Desktop.
Save sararob/4839f5b65e7076a090fed9efadb830be to your computer and use it in GitHub Desktop.

Revisions

  1. sararob created this gist Mar 30, 2018.
    5 changes: 5 additions & 0 deletions define-model.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    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’});