def fit(self, train_set, validation_set=None, restore_previous_model=False):
    '"\n        fit the model to the training data \n        INPUT PARAMETER train_set: training set\n        INPUT PARAMETER validation set.default None (Hence Optional)\n        INPUT PARAMETER restore_previous_model:\n                    if true, a previous trained model\n                    with the same name of this model is restored from disk to continue training.\n        OUTPUT: self \n        '
    if (validation_set is not None):
        self.validation_size = validation_set.shape[0]
    tf.reset_default_graph()
    self._build_model()
    with tf.Session() as self.tf_session:
        self._initialize_tf_utilities_and_ops(restore_previous_model)
        self._train_model(train_set, validation_set)
        self.tf_saver.save(self.tf_session, self.model_path)
        if self.plot_training_loss:
            plt.plot(self.training_losses)
            plt.title('Training batch losses v.s. iteractions')
            plt.xlabel('Num of training iteractions')
            plt.ylabel('Reconstruction error')
            plt.show()
"
fit the model to the training data 
INPUT PARAMETER train_set: training set
INPUT PARAMETER validation set.default None (Hence Optional)
INPUT PARAMETER restore_previous_model:
            if true, a previous trained model
            with the same name of this model is restored from disk to continue training.
OUTPUT: self
def fit(self, train_set, validation_set=None, restore_previous_model=False):
    '"\n        fit the model to the training data \n        INPUT PARAMETER train_set: training set\n        INPUT PARAMETER validation set.default None (Hence Optional)\n        INPUT PARAMETER restore_previous_model:\n                    if true, a previous trained model\n                    with the same name of this model is restored from disk to continue training.\n        OUTPUT: self \n        '
    if (validation_set is not None):
        self.validation_size = validation_set.shape[0]
    tf.reset_default_graph()
    self._build_model()
    with tf.Session() as self.tf_session:
        self._initialize_tf_utilities_and_ops(restore_previous_model)
        self._train_model(train_set, validation_set)
        self.tf_saver.save(self.tf_session, self.model_path)
        if self.plot_training_loss:
            plt.plot(self.training_losses)
            plt.title('Training batch losses v.s. iteractions')
            plt.xlabel('Num of training iteractions')
            plt.ylabel('Reconstruction error')
            plt.show()