Skip to content

Instantly share code, notes, and snippets.

@aniketbiprojit
Last active November 15, 2020 15:32
Show Gist options
  • Save aniketbiprojit/dbc3d95f190657ef2e5026f4e8661d4e to your computer and use it in GitHub Desktop.
Save aniketbiprojit/dbc3d95f190657ef2e5026f4e8661d4e to your computer and use it in GitHub Desktop.
Training model
const run = async (X_tensor,y_tensor,revision) => {
const model = await load_model()
model.fit(X_tensor, y_tensor, {
epochs: 10,
batchSize: 32,
callbacks: { onBatchEnd },
})
.then((info) => {
console.log('Final accuracy', info.history.acc)
})
model.save(`file:///${__dirname}/tfjs-${revision}`)
}
run(X_tensor,y_tensor,Date.now())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment