MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / trainModelUsingFitDatasetHandler

Function trainModelUsingFitDatasetHandler

data-generator/index.js:181–192  ·  view source on GitHub ↗

* Constructs a new model and trains it on a dataset pipeline built off of * GAME_GENERATOR_DATASET. The dataset pipeline performs feature calculation * and batching. * @see trainModelUsingFitDataset for training details.

()

Source from the content-addressed store, hash-verified

179 * @see trainModelUsingFitDataset for training details.
180 */
181async function trainModelUsingFitDatasetHandler() {
182 STOP_REQUESTED = false;
183 const model = createDNNModel();
184 model.compile({
185 optimizer: 'rmsprop',
186 loss: 'binaryCrossentropy',
187 metrics: ['accuracy'],
188 });
189 const dataset = GAME_GENERATOR_DATASET.map(gameToFeaturesAndLabel)
190 .batch(ui.getBatchSize());
191 trainModelUsingFitDataset(model, dataset);
192}
193
194/**
195 * Applies the model to the manually entered hand value and updates the UI with

Callers

nothing calls this directly

Calls 2

createDNNModelFunction · 0.85

Tested by

no test coverage detected