function parseArguments() {
  const parser =
      new ArgumentParser({description: 'Train RNNs for Jena weather problem'});
  parser.addArgument('--modelType', {
    type: 'string',
    defaultValue: 'gru',
    optionStrings: ['baseline', 'gru', 'simpleRNN'],
    // TODO(cais): Add more model types, e.g., gru with recurrent dropout.
    help: 'Type of the model to train. Use "baseline" to compute the ' +
    'commonsense baseline prediction error.'
  });
  parser.addArgument('--gpu', {
    action: 'storeTrue',
    help: 'Use GPU'
  });
  parser.addArgument('--lookBack', {
    type: 'int',
    defaultValue: 10 * 24 * 6,
    help: 'Look-back period (# of rows) for generating features'
  });
  parser.addArgument('--step', {
    type: 'int',
    defaultValue: 6,
    help: 'Step size (# of rows) used for generating features'
  });
  parser.addArgument('--delay', {
    type: 'int',
    defaultValue: 24 * 6,
    help: 'How many steps (# of rows) in the future to predict the ' +
        'temperature for'
  });
  parser.addArgument('--normalize', {
    defaultValue: true,
    help: 'Used normalized feature values (default: true)'
  });
  parser.addArgument('--includeDateTime', {
    action: 'storeTrue',
    help: 'Used date and time features (default: false)'
  });
  parser.addArgument(
      '--batchSize',
      {type: 'int', defaultValue: 128, help: 'Batch size for training'});
  parser.addArgument(
      '--epochs',
      {type: 'int', defaultValue: 20, help: 'Number of training epochs'});
  parser.addArgument( '--earlyStoppingPatience', {
    type: 'int',
    defaultValue: 2,
    help: 'Optional patience number for EarlyStoppingCallback'
   });
  parser.addArgument('--logDir', {
    type: 'string',
    help: 'Optional tensorboard log directory, to which the loss and ' +
    'accuracy will be logged during model training.'
  });
  parser.addArgument('--logUpdateFreq', {
    type: 'string',
    defaultValue: 'batch',
    optionStrings: ['batch', 'epoch'],
    help: 'Frequency at which the loss and accuracy will be logged to ' +
    'tensorboard.'
  });
  return parser.parseArgs();
}
Train recurrent neural networks (RNNs) for temperature prediction.

This script drives the RNN training process in the Node.js environment
using tfjs-node or tfjs-node-gpu (see the `--gpu` flag).

- See [data.js](./data.js) for how the Jena weather dataset is loaded.
- See [models.js](./train.js) for the detailed model creation and training
  logic.