'Adds an optimizer with learning rate decay to minimize self.loss.
Args:
optimizer_type: One of \'GradientDescent\', \'AdaGrad\', \'Momentum\', \'Adam\'.
Raises:
ValueError: if the optimizer type is unrecognized.'

def _AddOptimizer(self, optimizer_type):

    learn_rate_delta = (self.initial_learning_rate - self.final_learning_rate)
    learn_rate_dec = tf.add(tf.train.exponential_decay(learn_rate_delta, self.global_step, self.decay_steps, self.decay_rate), self.final_learning_rate)
    if (optimizer_type == 'GradientDescent'):
        opt = tf.train.GradientDescentOptimizer(learn_rate_dec)
    elif (optimizer_type == 'AdaGrad'):
        opt = tf.train.AdagradOptimizer(learn_rate_dec)
    elif (optimizer_type == 'Momentum'):
        opt = tf.train.MomentumOptimizer(learn_rate_dec, momentum=0.9)
    elif (optimizer_type == 'Adam'):
        opt = tf.train.AdamOptimizer(learning_rate=learn_rate_dec)
    else:
        raise ValueError(('Invalid    optimizer    type:    ' + optimizer_type))
    tf.summary.scalar('learn_rate', learn_rate_dec)
    self.train_op = opt.minimize(self.loss, global_step=self.global_step, name='train')
