'Callback indicate how long it took to run a batch'

def batch_completed(self, batch_size, duration):

    if (batch_size == self._effective_batch_size):
        old_duration = self._smoothed_batch_duration
        if (old_duration == 0):
            new_duration = duration
        else:
            new_duration = ((0.8 * old_duration) + (0.2 * duration))
        self._smoothed_batch_duration = new_duration
