infer(preprocessedInput) {
    const namedActivations = {};

    const avgpool10 = this.math.scope((keep) => {
      const conv1 = this.math.conv2d(
          preprocessedInput, this.variables['conv1_W:0'],
          this.variables['conv1_b:0'], 2, 0);
      const conv1relu = keep(this.math.relu(conv1));

      namedActivations['conv_1'] = conv1relu;

      const pool1 = keep(this.math.maxPool(conv1relu, 3, 2, 0));
      namedActivations['maxpool_1'] = pool1;

      const fire2 = keep(this.fireModule(pool1, 2));
      namedActivations['fire2'] = fire2;

      const fire3 = keep(this.fireModule(fire2, 3));
      namedActivations['fire3'] = fire3;

      // Because we don't have uneven padding yet, manually pad the ndarray on
      // the right.
      const fire3Reshape2d =
          fire3.as2D(fire3.shape[0], fire3.shape[1] * fire3.shape[2]);
      const fire3Sliced2d = this.math.slice2D(
          fire3Reshape2d, [0, 0],
          [fire3.shape[0] - 1, (fire3.shape[1] - 1) * fire3.shape[2]]);
      const fire3Sliced = fire3Sliced2d.as3D(
          fire3.shape[0] - 1, fire3.shape[1] - 1, fire3.shape[2]);
      const pool2 = keep(this.math.maxPool(fire3Sliced, 3, 2, 0));
      namedActivations['maxpool_2'] = pool2;

      const fire4 = keep(this.fireModule(pool2, 4));
      namedActivations['fire4'] = fire4;

      const fire5 = keep(this.fireModule(fire4, 5));
      namedActivations['fire5'] = fire5;

      const pool3 = keep(this.math.maxPool(fire5, 3, 2, 0));
      namedActivations['maxpool_3'] = pool3;

      const fire6 = keep(this.fireModule(pool3, 6));
      namedActivations['fire6'] = fire6;

      const fire7 = keep(this.fireModule(fire6, 7));
      namedActivations['fire7'] = fire7;

      const fire8 = keep(this.fireModule(fire7, 8));
      namedActivations['fire8'] = fire8;

      const fire9 = keep(this.fireModule(fire8, 9));
      namedActivations['fire9'] = fire9;

      const conv10 = keep(this.math.conv2d(
          fire9, this.variables['conv10_W:0'],
          this.variables['conv10_b:0'], 1, 0));
      namedActivations['conv10'] = conv10;

      return this.math.avgPool(conv10, conv10.shape[0], 1, 0).as1D();
    });

    return {namedActivations, logits: avgpool10};
  }
Infer through SqueezeNet, assumes variables have been loaded. This does
standard ImageNet pre-processing before inferring through the model. This
method returns named activations as well as pre-softmax logits. The user
needs to clean up namedActivations after inferring.

@param preprocessedInput preprocessed input Array.
@return Named activations and the pre-softmax logits.