class_docstr: Model for predicting autofills given context.
class_docstr_tok: ["Model","for","predicting","autofills","given","context","."]
docstr: Instantiates learning rate, decay op and train_op among others.
docstr_tok: ["Instantiates","learning","rate",",","decay","op","and","train_op","among","others","."]
code: def setup_optimizer(self):
      """Instantiates learning rate, decay op and train_op among others."""
      # If not training, don't need to add optimizer to the graph.
      if not self.is_training:
          self.train_op = tf.no_op()
          self.learning_rate = tf.no_op()
          return
  
      self.learning_rate = tf.Variable(
          self.hparams.learning_rate,
          name="learning_rate",
          trainable=False,
          dtype=tf.float32,
      )
  
      # FIXME 0.5 -> hparams.decay_rate
      self.decay_op = tf.assign(
          self.learning_rate, 0.5 * self.learning_rate
      )
      self.optimizer = tf.train.AdamOptimizer(
          learning_rate=self.learning_rate
      )
      self.train_op = self.optimizer.minimize(
          self.loss, global_step=tf.train.get_global_step()
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  from magenta.models.coconet import lib_hparams
  from magenta.models.coconet import lib_tfutil
  import tensorflow.compat.v1
label_desc: Use image node_id 12 for calling the CoconetGraph obj's underlying member method code with example usage: obj.setup_optimizer() without return types