'Train the model.
:param train_set: training set
:param validation_set: validation set. optional, default None
:return: self'

def _train_model(self, train_set, validation_set, train_ref=None, Validation_ref=None):

    pbar = tqdm(range(self.num_epochs))
    for i in pbar:
        self._run_train_step(train_set)
        if (validation_set is not None):
            feed = self._create_feed_dict(validation_set)
            err = tf_utils.run_summaries(self.tf_session, self.tf_merged_summaries, self.tf_summary_writer, i, feed, self.cost)
            pbar.set_description(('Reconstruction    loss:    %s' % err))
