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

def on_minibatch_end(self, callback_data, model, epoch, minibatch):

    if self.plot_per_mini:
        prev_epochs_minibatches = 0
        if (epoch > 0):
            prev_epochs_minibatches = callback_data['time_markers/minibatch'][(epoch - 1)]
        timestamp = (prev_epochs_minibatches + minibatch)
        self._save_hist_data(callback_data, model, timestamp)
