MCPcopy
hub / github.com/tensorflow/tfjs-examples / compileModel

Function compileModel

lstm-text-generation/model.js:52–57  ·  view source on GitHub ↗
(model, learningRate)

Source from the content-addressed store, hash-verified

50}
51
52export function compileModel(model, learningRate) {
53 const optimizer = tf.train.rmsprop(learningRate);
54 model.compile({optimizer: optimizer, loss: 'categoricalCrossentropy'});
55 console.log(`Compiled model with learning rate ${learningRate}`);
56 model.summary();
57}
58
59/**
60 * Train model.

Callers 2

mainFunction · 0.90
model_test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected