async generateExampleBatch(
      batchSize, numCircles, numLines, triangleProbability) {
    if (triangleProbability == null) {
      triangleProbability = 0.5;
    }
    const imageTensors = [];
    const targetTensors = [];
    for (let i = 0; i < batchSize; ++i) {
      const {image, target} =
          await this.generateExample(numCircles, numLines, triangleProbability);
      imageTensors.push(image);
      targetTensors.push(target);
    }
    const images = tf.stack(imageTensors);
    const targets = tf.stack(targetTensors);
    tf.dispose([imageTensors, targetTensors]);
    return {images, targets};
  }
Generate a number (i.e., batch) of examples.

@param {number} batchSize Number of example image in the batch.
@param {number} numCircles Number of circles (background object type)
  to include.
@param {number} numLines Number of line segments (background object type)
  to include.
@returns {Object} An object with the following fields:
  - image: A [batchSize, w, h, 3]-shaped tensor for the pixel content of
    the image. w and h are the width and height of the canvas,
    respectively.
  - target: A [batchSize, 5]-shaped tensor. The first column is a 0-1
    indicator for whether the target is a triangle(0) or a rectangle (1).
    The remaning four columns are the bounding box of the shape:
    [left, right, top, bottom], in the unit of pixels.