'Called when an epoch is about to end
Arguments:
callback_data (HDF5 dataset): shared data between callbacks
model (Model): model object
epoch (int): index of epoch that is ending'

def on_epoch_end(self, callback_data, model, epoch):

    if (((epoch + 1) % self.epoch_freq) == 0):
        self.eval_set.reset()
        stats = model.eval(self.eval_set, metric=self.metric)
        logger.info('%s:    %s', self.metric_desc, ',    '.join(map(str, stats.flatten())))
        for (ind, met) in enumerate(self.metric.metric_names):
            callback_data[('metrics/%s' % met)][(epoch // self.epoch_freq)] = stats[ind]
