def get_train_op(loss):
  """Build the gradient descent op for the model on `loss`."""
  gs = tf.train.get_global_step()
  is_boolq = FLAGS.dataset == "boolq"
  lr = tf.train.exponential_decay(
      global_step=gs,
      learning_rate=FLAGS.learning_rate,
      staircase=True,
      decay_steps=50 if is_boolq else 100,
      decay_rate=0.999)
  opt = tf.train.AdamOptimizer(lr)
  grad_and_vars = opt.compute_gradients(loss)
  return opt.apply_gradients(grad_and_vars, tf.train.get_global_step())
Build the gradient descent op for the model on `loss`.
language/boolq/run_recurrent_model_boolq.py