async function writeConvLayerFilters(
    model, layerName, numFilters, iterations, outputDir) {
  const filePaths = [];
  const maxFilters = model.getLayer(layerName).getWeights()[0].shape[3];
  if (numFilters > maxFilters) {
    numFilters = maxFilters;
  }
  for (let i = 0; i < numFilters; ++i) {
    console.log(
        `Processing layer ${layerName}, filter ${i + 1} of ${numFilters}`);
    const imageTensor =
        filters.inputGradientAscent(model, layerName, i, iterations);
    const outputFilePath = path.join(outputDir, `${layerName}_${i + 1}.png`);
    filePaths.push(outputFilePath);
    await utils.writeImageTensorToFile(imageTensor, outputFilePath);
    imageTensor.dispose();
    console.log(`  --> ${outputFilePath}`);
  }
  return filePaths;
}
Calcuate and save the maximally-activating input images for a covn2d layer.

@param {tf.Model} model The model that the conv2d layer of interest belongs
  to.
@param {string} layerName The name of the layer of interest.
@param {number} numFilters Number of the conv2d layer's filter to calculate
  maximally-activating inputs for. If this exceeds the number of filters
  that the conv2d layer has, it will be cut off.
@param {string} outputDir Path to the directory to which the output image
  will be written.
@returns {string[]} Paths to the image files generated in this call.