Skip to content

Instantly share code, notes, and snippets.

@jcblw
Last active October 10, 2022 14:55
Show Gist options
  • Save jcblw/9ec839c861aa159669ea5408893cc604 to your computer and use it in GitHub Desktop.
Save jcblw/9ec839c861aa159669ea5408893cc604 to your computer and use it in GitHub Desktop.
Used for a Medium article
// Create a model for predicting the next word
// ^ I wrote this
const model = tf.sequential()
model.add(tf.layers.lstm({ units: 128, inputShape: [null, 1] }))
model.add(tf.layers.dense({ units: 1, activation: 'softmax' }))
model.compile({ loss: 'categoricalCrossentropy', optimizer: 'adam' })
// ^ Copilot wrote all this code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment