lstmLayerSizes() {
    if (this.model == null) {
      throw new Error('Create model first.');
    }
    const numLSTMLayers = this.model.layers.length - 1;
    const layerSizes = [];
    for (let i = 0; i < numLSTMLayers; ++i) {
      layerSizes.push(this.model.layers[i].units);
    }
    return layerSizes.length === 1 ? layerSizes[0] : layerSizes;
  }
Get a representation of the sizes of the LSTM layers in the model.

@returns {number | number[]} The sizes (i.e., number of units) of the
  LSTM layers that the model contains. If there is only one LSTM layer, a
  single number is returned; else, an Array of numbers is returned.