def on_epoch_end(self, epoch, logs=None):
    val_acc = evaluate(valid_generator)
    if (val_acc > self.best_val_acc):
        self.best_val_acc = val_acc
        model.save_weights('best_model.weights')
    print((u'val_acc: %.5f, best_val_acc: %.5f\n' % (val_acc, self.best_val_acc)))
def on_epoch_end(self, epoch, logs=None):
    val_acc = evaluate(valid_generator)
    if (val_acc > self.best_val_acc):
        self.best_val_acc = val_acc
        model.save_weights('best_model.weights')
    print((u'val_acc: %.5f, best_val_acc: %.5f\n' % (val_acc, self.best_val_acc)))