function createModel(sampleLen, charSetSize, lstmLayerSizes) {
  if (!Array.isArray(lstmLayerSizes)) {
    lstmLayerSizes = [lstmLayerSizes];
  }

  const model = tf.sequential();
  for (let i = 0; i < lstmLayerSizes.length; ++i) {
    const lstmLayerSize = lstmLayerSizes[i];
    model.add(tf.layers.lstm({
      units: lstmLayerSize,
      returnSequences: i < lstmLayerSizes.length - 1,
      inputShape: i === 0 ? [sampleLen, charSetSize] : undefined
    }));
  }
  model.add(
      tf.layers.dense({units: charSetSize, activation: 'softmax'}));

  return model;
}
Create a model for next-character prediction.
@param {number} sampleLen Sampling length: how many characters form the
  input to the model.
@param {number} charSetSize Size of the character size: how many unique
  characters there are.
@param {number|numbre[]} lstmLayerSizes Size(s) of the LSTM layers.
@return {tf.Model} A next-character prediction model with an input shape
  of `[null, sampleLen, charSetSize]` and an output shape of
  `[null, charSetSize]`.