'Called when training is about to begin
Arguments:
callback_data (HDF5 dataset): shared data between callbacks
model (Model): model object
epochs (int): Total epochs'

def on_train_begin(self, callback_data, model, epochs):

    timing = callback_data.create_group('time/train')
    timing.create_dataset('start_time', (1,), dtype='float64')
    timing.create_dataset('end_time', (1,), dtype='float64')
    timing['start_time'][0] = time.time()
    timing['start_time'].attrs['units'] = 'seconds'
