Method to compute exact loss for testing
Test derivatives