def _param_grad_helper(self,X,X2,target):
if X2 is None: X2 = X<EOL>FX = np.column_stack([f(X) for f in self.F])<EOL>FX2 = np.column_stack([f(X2) for f in self.F])<EOL>DER = np.zeros((self.n,self.n,self.n))<EOL>for i in range(self.n):<EOL><INDENT>DER[i,i,i] = np.sqrt(self.weights[i])<EOL><DEDENT>dw = self.variance * mdot(FX,DER,self.G_1,np.diag(np.sqrt(self.weights)),FX2.T)<EOL>dv = mdot(FX,np.diag(np.sqrt(self.weights)),self.G_1,np.diag(np.sqrt(self.weights)),FX2.T)<EOL>np.add(target[:,:,<NUM_LIT:0>],np.transpose(dv,(<NUM_LIT:0>,<NUM_LIT:2>,<NUM_LIT:1>)), target[:,:,<NUM_LIT:0>])<EOL>np.add(target[:,:,<NUM_LIT:1>:],np.transpose(dw,(<NUM_LIT:0>,<NUM_LIT:2>,<NUM_LIT:1>)), target[:,:,<NUM_LIT:1>:])<EOL>
Return shape is NxMx(Ntheta)