Loss function tests template