def on_epoch_end(self, epoch, logs={}):
    if ((self.number % self.validation_frequency) != 0):
        self.number += 1
        return
    validation = Validation()
    validation.set_validation_data(self.validationSequences).set_dimensions(self.size).set_base(self.base).set_step(self.step).validate(self.algorithm)
    self.number += 1
    self.logs.append(logs)
    self.losses.append(logs.get('loss'))
    self.acc.append(logs.get('acc'))
    self.val_losses.append(logs.get('val_loss'))
    self.val_acc.append(logs.get('val_acc'))
    if (len(self.losses) > 1):
        N = np.arange(0, len(self.losses))
        plt.figure()
        plt.plot(N, self.losses, label='train_loss')
        plt.plot(N, self.acc, label='train_acc')
        plt.plot(N, self.val_losses, label='val_loss')
        plt.plot(N, self.val_acc, label='val_acc')
        plt.title('Training Loss and Accuracy [Epoch {}]'.format(epoch))
        plt.xlabel('Epoch #')
        plt.ylabel('Loss/Accuracy')
        plt.legend()
        plt.savefig('../output/Epoch-{}.png'.format(epoch))
        plt.close()
    return
def on_epoch_end(self, epoch, logs={}):
    if ((self.number % self.validation_frequency) != 0):
        self.number += 1
        return
    validation = Validation()
    validation.set_validation_data(self.validationSequences).set_dimensions(self.size).set_base(self.base).set_step(self.step).validate(self.algorithm)
    self.number += 1
    self.logs.append(logs)
    self.losses.append(logs.get('loss'))
    self.acc.append(logs.get('acc'))
    self.val_losses.append(logs.get('val_loss'))
    self.val_acc.append(logs.get('val_acc'))
    if (len(self.losses) > 1):
        N = np.arange(0, len(self.losses))
        plt.figure()
        plt.plot(N, self.losses, label='train_loss')
        plt.plot(N, self.acc, label='train_acc')
        plt.plot(N, self.val_losses, label='val_loss')
        plt.plot(N, self.val_acc, label='val_acc')
        plt.title('Training Loss and Accuracy [Epoch {}]'.format(epoch))
        plt.xlabel('Epoch #')
        plt.ylabel('Loss/Accuracy')
        plt.legend()
        plt.savefig('../output/Epoch-{}.png'.format(epoch))
        plt.close()
    return