'Step 5: define optimizer'

def _create_optimizer(self):

    with tf.device('/cpu:0'):
        self.optimizer = tf.train.GradientDescentOptimizer(self.lr).minimize(self.loss, global_step=self.global_step)
