class_docstr: Abstract base class for models.
  
  Args:
    params: A dictionary of hyperparameter values
    name: A name for this model to be used as a variable scope
class_docstr_tok: ["Abstract","base","class","for","models",".","Args",":","params",":","A","dictionary","of","hyperparameter","values","name",":","A","name","for","this","model","to","be","used","as","a","variable","scope"]
docstr: Creates the optimizer
docstr_tok: ["Creates","the","optimizer"]
code: def _create_optimizer(self):
      """Creates the optimizer"""
      name = self.params["optimizer.name"]
      optimizer = tf.contrib.layers.OPTIMIZER_CLS_NAMES[name](
          learning_rate=self.params["optimizer.learning_rate"],
          **self.params["optimizer.params"],
      )
  
      # Optionally wrap with SyncReplicasOptimizer
      if self.params["optimizer.sync_replicas"] > 0:
          optimizer = tf.train.SyncReplicasOptimizer(
              opt=optimizer,
              replicas_to_aggregate=self.params[
                  "optimizer.sync_replicas_to_aggregate"
              ],
              total_num_replicas=self.params["optimizer.sync_replicas"],
          )
          # This is really ugly, but we need to do this to make the optimizer
          # accessible outside of the model.
          global_vars.SYNC_REPLICAS_OPTIMIZER = optimizer
  
      return optimizer
  
file_path: seq2seq/seq2seq/models/model_base.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import collections
  import tensorflow
  from seq2seq.configurable import Configurable
  from seq2seq.training import utils
  from seq2seq import global_vars
label_desc: Use image node_id 3 for calling the ModelBase obj's underlying member method code with example usage: obj._create_optimizer() and returns: optimizer