Skip to content

Instantly share code, notes, and snippets.

@Rishit-dagli
Created March 31, 2020 14:24
Show Gist options
  • Save Rishit-dagli/ff41bc13df6a90128baf25dc56be089c to your computer and use it in GitHub Desktop.
Save Rishit-dagli/ff41bc13df6a90128baf25dc56be089c to your computer and use it in GitHub Desktop.
Simple model with TF.js
function createModel() {
// Create a sequential model
const model = tf.sequential();
// Add a single input layer
model.add(tf.layers.dense({inputShape: [1], units: 1, useBias: true}));
// Add an output layer
model.add(tf.layers.dense({units: 1, useBias: true}));
return model;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment