def gradients_X(self, dL_dK, X, X2, target):
<EOL>self._K_computations(X, X2)<EOL>if X2 is None:<EOL><INDENT>_K_dist = <NUM_LIT:2>*(X[:, None, :] - X[None, :, :])<EOL><DEDENT>else:<EOL><INDENT>_K_dist = X[:, None, :] - X2[None, :, :] <EOL><DEDENT>gradients_X = (-<NUM_LIT>*self.variance)*np.transpose((self._K_dvar/self._w2)[:, :, None]*_K_dist, (<NUM_LIT:1>, <NUM_LIT:0>, <NUM_LIT:2>))<EOL>target += np.sum(gradients_X*dL_dK.T[:, :, None], <NUM_LIT:0>)<EOL>self._dK_computations(dL_dK)<EOL>if X2 is None:<EOL><INDENT>target += <NUM_LIT>*self.mapping.df_dX(self._dL_dl[:, None], X)<EOL><DEDENT>else:<EOL><INDENT>target += self.mapping.df_dX(self._dL_dl[:, None], X)<EOL><DEDENT>
Derivative of the covariance matrix with respect to X.