コード例 #1
0
ファイル: savigp.py プロジェクト: jfutoma/savigp
    def _update_inverses(self):
        """
        Calculates and stores kernel, and its inverses.
        """

        for j in range(self.num_latent_proc):
            self.Kzz[j, :, :] = self.kernels_latent[j].K(self.Z[j, :, :])
            self.chol[j, :, :] = jitchol(self.Kzz[j, :, :])
            self.invZ[j, :, :] = inv_chol(self.chol[j, :, :])
            self.log_detZ[j] = pddet(self.chol[j, :, :])
        self.hypers_changed = False
        self.inducing_changed = False
コード例 #2
0
    def _update_inverses(self):
        """
        Calculates and stores kernel, and its inverses.
        """

        for j in range(self.num_latent_proc):
            self.Kzz[j, :, :] = self.kernels_latent[j].K(self.Z[j, :, :])
            self.chol[j, :, :] = jitchol(self.Kzz[j, :, :])
            self.invZ[j, :, :] = inv_chol(self.chol[j, :, :])
            self.log_detZ[j] = pddet(self.chol[j, :, :])
        self.hypers_changed = False
        self.inducing_changed = False
コード例 #3
0
ファイル: mog_single_comp.py プロジェクト: jfutoma/savigp
 def update_covariance(self, j, Sj):
     Sj = Sj.copy()
     mm = min(Sj[np.diag_indices_from(Sj)])
     if mm < 0:
         Sj[np.diag_indices_from(Sj)] = Sj[np.diag_indices_from(Sj)] - 1.1 * mm
     for k in range(self.num_comp):
         self.s[k,j] = Sj.copy()
         self.L[k,j] = jitchol(Sj,10)
         tmp = self.L[k,j].copy()
         tmp[np.diag_indices_from(tmp)] = np.log(tmp[np.diag_indices_from(tmp)])
         self.L_flatten[k,j] = tmp[np.tril_indices_from(tmp)]
     self._update()
コード例 #4
0
 def update_covariance(self, j, Sj):
     Sj = Sj.copy()
     mm = min(Sj[np.diag_indices_from(Sj)])
     if mm < 0:
         Sj[np.diag_indices_from(
             Sj)] = Sj[np.diag_indices_from(Sj)] - 1.1 * mm
     for k in range(self.num_comp):
         self.s[k, j] = Sj.copy()
         self.L[k, j] = jitchol(Sj, 10)
         tmp = self.L[k, j].copy()
         tmp[np.diag_indices_from(tmp)] = np.log(
             tmp[np.diag_indices_from(tmp)])
         self.L_flatten[k, j] = tmp[np.tril_indices_from(tmp)]
     self._update()