'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):

    points = callback_data['config'].attrs['total_minibatches']
    callback_data.create_dataset('cost/train', (points,))
    self.wsz = min(points, self.wsz)
    self.cost_history = deque([], maxlen=int(self.wsz))
    callback_data['cost/train'].attrs['time_markers'] = 'minibatch'
