function onTrainBatchEnd(logs, progress, examplesPerSec) {
  logStatus(
      `Model training: ${(progress * 1e2).toFixed(1)}% complete... ` +
      `(${examplesPerSec.toFixed(0)} examples/s)`);
  batchLossValues.push(logs);
  const container = document.getElementById('batch-loss-canvas');
  tfvis.show.history(container, batchLossValues, ['loss'], {
    height: 300,
    zoomToFit: true,
    xLabel: 'Batch',
  });
}
A function to call when a batch is competed during training.

@param {number} loss Loss value of the current batch.
@param {number} progress Total training progress, as a number between 0
  and 1.
@param {number} examplesPerSec The training speed in the batch, in examples
  per second.