async function trainModel(
    model, jenaWeatherData, normalize, includeDateTime, lookBack, step, delay,
    batchSize, epochs, customCallback) {
  const trainShuffle = true;
  const trainDataset =
      tf.data
          .generator(
              () => jenaWeatherData.getNextBatchFunction(
                  trainShuffle, lookBack, delay, batchSize, step, TRAIN_MIN_ROW,
                  TRAIN_MAX_ROW, normalize, includeDateTime))
          .prefetch(8);
  const evalShuffle = false;
  const valDataset = tf.data.generator(
      () => jenaWeatherData.getNextBatchFunction(
          evalShuffle, lookBack, delay, batchSize, step, VAL_MIN_ROW,
          VAL_MAX_ROW, normalize, includeDateTime));

  await model.fitDataset(trainDataset, {
    batchesPerEpoch: 500,
    epochs,
    callbacks: customCallback,
    validationData: valDataset
  });
}
Train a model on the Jena weather data.

@param {tf.LayersModel} model A compiled tf.LayersModel object. It is
  expected to have a 3D input shape `[numExamples, timeSteps, numFeatures].`
  and an output shape `[numExamples, 1]` for predicting the temperature
value.
@param {JenaWeatherData} jenaWeatherData A JenaWeatherData object.
@param {boolean} normalize Whether to used normalized data for training.
@param {boolean} includeDateTime Whether to include date and time features
  in training.
@param {number} lookBack Number of look-back time steps.
@param {number} step Step size used to generate the input features.
@param {number} delay How many steps in the future to make the prediction
  for.
@param {number} batchSize batchSize for training.
@param {number} epochs Number of training epochs.
@param {tf.Callback | tf.CustomCallbackArgs} customCallback Optional callback
  to invoke at the end of every epoch. Can optionally have `onBatchEnd` and
  `onEpochEnd` fields.