'_train.
Training process for this optimizer.
Arguments:
training_step: `int`. The global step.
snapshot_epoch: `bool`. If True, snapshot network at each epoch.
snapshot_step: `int`. If not None, snapshot network given \'step\'.
show_metric: `bool`. If True, display accuracy at every step.'

def _train(self, training_step, snapshot_epoch, snapshot_step, show_metric):

    (self.loss_value, self.acc_value) = (None, None)
    (self.val_loss, self.val_acc) = (None, None)
    (train_summ_str, test_summ_str) = (None, None)
    snapshot = False
    epoch = self.train_dflow.data_status.epoch
    feed_batch = self.train_dflow.next()
    tflearn.is_training(True, session=self.session)
    (_, train_summ_str) = self.session.run([self.train, self.summ_op], feed_batch)
    sname = ('Loss/' + self.scope_name)
    self.loss_value = summaries.get_value_from_summary_string(sname, train_summ_str)
    if (show_metric and (self.metric is not None)):
        sname = ((self.metric_summ_name + '/') + self.scope_name)
        self.acc_value = summaries.get_value_from_summary_string(sname, train_summ_str)
    if (epoch != self.train_dflow.data_status.epoch):
        if snapshot_epoch:
            snapshot = True
    if snapshot_step:
        if ((training_step % snapshot_step) == 0):
            snapshot = True
    if (snapshot and self.val_feed_dict):
        tflearn.is_training(False, session=self.session)
        eval_ops = ([self.loss] + self.validation_monitors)
        if (show_metric and (self.metric is not None)):
            eval_ops.append(self.metric)
        e = evaluate_flow(self.session, eval_ops, self.test_dflow)
        self.val_loss = e[0]
        if (show_metric and (self.metric is not None)):
            self.validation_monitor_values = e[1:(-1)]
            self.val_acc = e[(-1)]
        else:
            self.validation_monitor_values = e[1:]
        update_val_op = [self.val_loss_assign]
        update_val_feed = {self.val_loss_P: self.val_loss}
        if show_metric:
            update_val_op.append(self.val_acc_assign)
            update_val_feed[self.val_acc_P] = self.val_acc
        if self.validation_monitors:
            update_val_op.append(self.val_monitors_assign)
            for (vmp, vmv) in zip(self.val_monitors_P, self.validation_monitor_values):
                update_val_feed[vmp] = vmv
        self.session.run(update_val_op, feed_dict=update_val_feed)
        test_summ_str = self.session.run(self.val_summary_op)
    n_step = self.training_steps.eval(session=self.session)
    if (n_step > 1):
        if train_summ_str:
            self.summary_writer.add_summary(train_summ_str, n_step)
        if test_summ_str:
            self.summary_writer.add_summary(test_summ_str, n_step)
    return snapshot
