delta functions and update to gradLogLoss