FITC_network.py 文件源码

python
阅读 45 收藏 0 点赞 0 评论 0

项目:deepGP_approxEP 作者: thangbui 项目源码 文件源码
def update_hypers(self, params):
        for i in range(self.no_layers):
            Mi = self.no_pseudos[i]
            Dini = self.layer_sizes[i]
            Douti = self.layer_sizes[i+1]
            self.ls[i] = params['ls'][i]
            self.ones_M_ls[i] = np.outer(self.ones_M[i], 1.0 / np.exp(2*self.ls[i]))
            self.sf[i] = params['sf'][i]
            if not ((self.no_output_noise) and (i == self.no_layers-1)):
                self.sn[i] = params['sn'][i]
            triu_ind = np.triu_indices(Mi)
            diag_ind = np.diag_indices(Mi)
            if self.zu_tied:
                zi = params['zu'][i]
                self.zu[i] = zi
            else:
                for d in range(Douti):
                    zid = params['zu'][i][d]
                    self.zu[i][d] = zid

            for d in range(Douti):
                theta_m_d = params['eta2'][i][d]
                theta_R_d = params['eta1_R'][i][d]
                R = np.zeros((Mi, Mi))
                R[triu_ind] = theta_R_d.reshape(theta_R_d.shape[0], )
                R[diag_ind] = np.exp(R[diag_ind])
                self.theta_1_R[i][d] = R
                self.theta_1[i][d] = np.dot(R.T, R)
                self.theta_2[i][d] = theta_m_d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号