@silence_errors<EOL><INDENT>def update_gradients_full(self,dL_dK,X,X2):<DEDENT>
if X2 is None: X2 = X<EOL>FX  = self._cos(self.basis_alpha[None,:],self.basis_omega[None,:],self.basis_phi[None,:])(X)<EOL>FX2 = self._cos(self.basis_alpha[None,:],self.basis_omega[None,:],self.basis_phi[None,:])(X2)<EOL>La = np.column_stack((self.a[<NUM_LIT:0>]*np.ones((self.n_basis,<NUM_LIT:1>)),self.a[<NUM_LIT:1>]*self.basis_omega,self.a[<NUM_LIT:2>]*self.basis_omega**<NUM_LIT:2>))<EOL>Lo = np.column_stack((self.basis_omega,self.basis_omega,self.basis_omega))<EOL>Lp = np.column_stack((self.basis_phi,self.basis_phi+np.pi/<NUM_LIT:2>,self.basis_phi+np.pi))<EOL>r,omega,phi =  self._cos_factorization(La,Lo,Lp)<EOL>Gint = self._int_computation( r,omega,phi, r,omega,phi)<EOL>Flower = np.array(self._cos(self.basis_alpha,self.basis_omega,self.basis_phi)(self.lower))[:,None]<EOL>F1lower = np.array(self._cos(self.basis_alpha*self.basis_omega,self.basis_omega,self.basis_phi+np.pi/<NUM_LIT:2>)(self.lower))[:,None]<EOL>dK_dvar = <NUM_LIT:1.>/self.variance*mdot(FX,self.Gi,FX2.T)<EOL>da_dlen = [-<NUM_LIT:6>/self.lengthscale**<NUM_LIT:3>,-<NUM_LIT:2>*np.sqrt(<NUM_LIT:3>)/self.lengthscale**<NUM_LIT:2>,<NUM_LIT:0.>]<EOL>db_dlen = [<NUM_LIT:0.>,<NUM_LIT:2>*self.lengthscale/<NUM_LIT>]<EOL>dLa_dlen =  np.column_stack((da_dlen[<NUM_LIT:0>]*np.ones((self.n_basis,<NUM_LIT:1>)),da_dlen[<NUM_LIT:1>]*self.basis_omega,da_dlen[<NUM_LIT:2>]*self.basis_omega**<NUM_LIT:2>))<EOL>r1,omega1,phi1 = self._cos_factorization(dLa_dlen,Lo,Lp)<EOL>dGint_dlen = self._int_computation(r1,omega1,phi1, r,omega,phi)<EOL>dGint_dlen = dGint_dlen + dGint_dlen.T<EOL>dG_dlen = self.lengthscale**<NUM_LIT:2>/(<NUM_LIT:4>*np.sqrt(<NUM_LIT:3>))*Gint + self.lengthscale**<NUM_LIT:3>/(<NUM_LIT:12>*np.sqrt(<NUM_LIT:3>))*dGint_dlen + db_dlen[<NUM_LIT:0>]*np.dot(Flower,Flower.T) + db_dlen[<NUM_LIT:1>]*np.dot(F1lower,F1lower.T)<EOL>dK_dlen = -mdot(FX,self.Gi,dG_dlen/self.variance,self.Gi,FX2.T)<EOL>dFX_dper  = self._cos(-self.basis_alpha[None,:]*self.basis_omega[None,:]/self.period*X ,self.basis_omega[None,:],self.basis_phi[None,:]+np.pi/<NUM_LIT:2>)(X)<EOL>dFX2_dper = self._cos(-self.basis_alpha[None,:]*self.basis_omega[None,:]/self.period*X2,self.basis_omega[None,:],self.basis_phi[None,:]+np.pi/<NUM_LIT:2>)(X2)<EOL>dLa_dper = np.column_stack((-self.a[<NUM_LIT:0>]*self.basis_omega/self.period, -self.a[<NUM_LIT:1>]*self.basis_omega**<NUM_LIT:2>/self.period, -self.a[<NUM_LIT:2>]*self.basis_omega**<NUM_LIT:3>/self.period))<EOL>dLp_dper = np.column_stack((self.basis_phi+np.pi/<NUM_LIT:2>,self.basis_phi+np.pi,self.basis_phi+np.pi*<NUM_LIT:3>/<NUM_LIT:2>))<EOL>r1,omega1,phi1 =  self._cos_factorization(dLa_dper,Lo,dLp_dper)<EOL>IPPprim1 =  self.upper*(<NUM_LIT:1.>/(omega+omega1.T)*np.cos((omega+omega1.T)*self.upper+phi+phi1.T-np.pi/<NUM_LIT:2>)  +  <NUM_LIT:1.>/(omega-omega1.T)*np.cos((omega-omega1.T)*self.upper+phi-phi1.T-np.pi/<NUM_LIT:2>))<EOL>IPPprim1 -= self.lower*(<NUM_LIT:1.>/(omega+omega1.T)*np.cos((omega+omega1.T)*self.lower+phi+phi1.T-np.pi/<NUM_LIT:2>)  +  <NUM_LIT:1.>/(omega-omega1.T)*np.cos((omega-omega1.T)*self.lower+phi-phi1.T-np.pi/<NUM_LIT:2>))<EOL>IPPprim2 =  self.upper*(<NUM_LIT:1.>/(omega+omega1.T)*np.cos((omega+omega1.T)*self.upper+phi+phi1.T-np.pi/<NUM_LIT:2>)  + self.upper*np.cos(phi-phi1.T))<EOL>IPPprim2 -= self.lower*(<NUM_LIT:1.>/(omega+omega1.T)*np.cos((omega+omega1.T)*self.lower+phi+phi1.T-np.pi/<NUM_LIT:2>)  + self.lower*np.cos(phi-phi1.T))<EOL>IPPprim = np.where(np.isnan(IPPprim1),IPPprim2,IPPprim1)<EOL>IPPint1 =  <NUM_LIT:1.>/(omega+omega1.T)**<NUM_LIT:2>*np.cos((omega+omega1.T)*self.upper+phi+phi1.T-np.pi)  +  <NUM_LIT:1.>/(omega-omega1.T)**<NUM_LIT:2>*np.cos((omega-omega1.T)*self.upper+phi-phi1.T-np.pi)<EOL>IPPint1 -= <NUM_LIT:1.>/(omega+omega1.T)**<NUM_LIT:2>*np.cos((omega+omega1.T)*self.lower+phi+phi1.T-np.pi)  +  <NUM_LIT:1.>/(omega-omega1.T)**<NUM_LIT:2>*np.cos((omega-omega1.T)*self.lower+phi-phi1.T-np.pi)<EOL>IPPint2 =  <NUM_LIT:1.>/(omega+omega1.T)**<NUM_LIT:2>*np.cos((omega+omega1.T)*self.upper+phi+phi1.T-np.pi)  + <NUM_LIT:1.>/<NUM_LIT:2>*self.upper**<NUM_LIT:2>*np.cos(phi-phi1.T)<EOL>IPPint2 -= <NUM_LIT:1.>/(omega+omega1.T)**<NUM_LIT:2>*np.cos((omega+omega1.T)*self.lower+phi+phi1.T-np.pi)  + <NUM_LIT:1.>/<NUM_LIT:2>*self.lower**<NUM_LIT:2>*np.cos(phi-phi1.T)<EOL>IPPint = np.where(np.isnan(IPPint1),IPPint2,IPPint1)<EOL>dLa_dper2 = np.column_stack((-self.a[<NUM_LIT:1>]*self.basis_omega/self.period, -<NUM_LIT:2>*self.a[<NUM_LIT:2>]*self.basis_omega**<NUM_LIT:2>/self.period))<EOL>dLp_dper2 = np.column_stack((self.basis_phi+np.pi/<NUM_LIT:2>,self.basis_phi+np.pi))<EOL>r2,omega2,phi2 =  self._cos_factorization(dLa_dper2,Lo[:,<NUM_LIT:0>:<NUM_LIT:2>],dLp_dper2)<EOL>dGint_dper = np.dot(r,r1.T)/<NUM_LIT:2> * (IPPprim - IPPint) +  self._int_computation(r2,omega2,phi2, r,omega,phi)<EOL>dGint_dper = dGint_dper + dGint_dper.T<EOL>dFlower_dper  = np.array(self._cos(-self.lower*self.basis_alpha*self.basis_omega/self.period,self.basis_omega,self.basis_phi+np.pi/<NUM_LIT:2>)(self.lower))[:,None]<EOL>dF1lower_dper = np.array(self._cos(-self.lower*self.basis_alpha*self.basis_omega**<NUM_LIT:2>/self.period,self.basis_omega,self.basis_phi+np.pi)(self.lower)+self._cos(-self.basis_alpha*self.basis_omega/self.period,self.basis_omega,self.basis_phi+np.pi/<NUM_LIT:2>)(self.lower))[:,None]<EOL>dG_dper = <NUM_LIT:1.>/self.variance*(self.lengthscale**<NUM_LIT:3>/(<NUM_LIT:12>*np.sqrt(<NUM_LIT:3>))*dGint_dper + self.b[<NUM_LIT:0>]*(np.dot(dFlower_dper,Flower.T)+np.dot(Flower,dFlower_dper.T)) + self.b[<NUM_LIT:1>]*(np.dot(dF1lower_dper,F1lower.T)+np.dot(F1lower,dF1lower_dper.T)))<EOL>dK_dper = mdot(dFX_dper,self.Gi,FX2.T) - mdot(FX,self.Gi,dG_dper,self.Gi,FX2.T) + mdot(FX,self.Gi,dFX2_dper.T)<EOL>self.variance.gradient = np.sum(dK_dvar*dL_dK)<EOL>self.lengthscale.gradient = np.sum(dK_dlen*dL_dK)<EOL>self.period.gradient = np.sum(dK_dper*dL_dK)<EOL>
derivative of the covariance matrix with respect to the parameters (shape is num_data x num_inducing x num_params)