Using callbacks during training and validation