mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-07 11:02:38 +02:00
implement update_gradients_diag for MLP kernel
This commit is contained in:
parent
4fc006f45d
commit
1da44d9d5c
1 changed files with 8 additions and 2 deletions
|
|
@ -79,8 +79,14 @@ class MLP(Kern):
|
|||
+ 2*self.bias_variance + 2.))*base_cov_grad).sum()
|
||||
|
||||
def update_gradients_diag(self, X):
|
||||
raise NotImplementedError, "TODO"
|
||||
|
||||
self._K_diag_computations(X)
|
||||
self.variance.gradient = np.sum(self._K_diag_dvar*dL_dKdiag)
|
||||
|
||||
base = four_over_tau*self.variance/np.sqrt(1-self._K_diag_asin_arg*self._K_diag_asin_arg)
|
||||
base_cov_grad = base*dL_dKdiag/np.square(self._K_diag_denom)
|
||||
|
||||
self.weight_variance.gradient = (base_cov_grad*np.square(X).sum(axis=1)).sum()
|
||||
self.bias_variance.gradient = base_cov_grad.sum()
|
||||
|
||||
def gradients_X(self, dL_dK, X, X2):
|
||||
"""Derivative of the covariance matrix with respect to X"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue