#NEWLINE# def update_gradients_expectations( self , dL_dpsi0 , dL_dpsi1 , dL_dpsi2 , Z , variational_posterior ) : #NEWLINE# #INDENT# '\n        Set the gradients of all parameters when doing inference with\n        uncertain inputs, using expectations of the kernel.\n\n        The essential maths is\n\n        .. math::\n\n            \\frac{\\partial L}{\\partial \\theta_i} & = \\frac{\\partial L}{\\partial \\psi_0}\\frac{\\partial \\psi_0}{\\partial \\theta_i}\\\n                & \\quad + \\frac{\\partial L}{\\partial \\psi_1}\\frac{\\partial \\psi_1}{\\partial \\theta_i}\\\n                & \\quad + \\frac{\\partial L}{\\partial \\psi_2}\\frac{\\partial \\psi_2}{\\partial \\theta_i}\n\n        Thus, we push the different derivatives through the gradients of the psi\n        statistics. Be sure to set the gradients for all kernel\n        parameters here.\n        ' #NEWLINE# dtheta = self . psicomp . psiDerivativecomputations ( self , dL_dpsi0 , dL_dpsi1 , dL_dpsi2 , Z , variational_posterior ) [ 0 ] #NEWLINE# self . gradient [ : ] = dtheta