(
model, textData, numEpochs, examplesPerEpoch, batchSize, validationSplit,
callbacks)
| 71 | * `model.fit()` calls. |
| 72 | */ |
| 73 | export 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. |
no test coverage detected