MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / fitModel

Function fitModel

lstm-text-generation/model.js:73–87  ·  view source on GitHub ↗
(
    model, textData, numEpochs, examplesPerEpoch, batchSize, validationSplit,
    callbacks)

Source from the content-addressed store, hash-verified

71 * `model.fit()` calls.
72 */
73export async function fitModel(
74 model, textData, numEpochs, examplesPerEpoch, batchSize, validationSplit,
75 callbacks) {
76 for (let i = 0; i < numEpochs; ++i) {
77 const [xs, ys] = textData.nextDataEpoch(examplesPerEpoch);
78 await model.fit(xs, ys, {
79 epochs: 1,
80 batchSize: batchSize,
81 validationSplit,
82 callbacks
83 });
84 xs.dispose();
85 ys.dispose();
86 }
87}
88
89/**
90 * Generate text using a next-char-prediction model.

Callers 2

mainFunction · 0.90
model_test.jsFile · 0.90

Calls 1

nextDataEpochMethod · 0.80

Tested by

no test coverage detected