本文整理匯總了Python中rbm.RBM._clogprob_vis_hid方法的典型用法代碼示例。如果您正苦於以下問題:Python RBM._clogprob_vis_hid方法的具體用法?Python RBM._clogprob_vis_hid怎麽用?Python RBM._clogprob_vis_hid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rbm.RBM
的用法示例。
在下文中一共展示了RBM._clogprob_vis_hid方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _ulogprob_hid
# 需要導入模塊: from rbm import RBM [as 別名]
# 或者: from rbm.RBM import _clogprob_vis_hid [as 別名]
def _ulogprob_hid(self, Y, num_is_samples=100):
"""
Estimates the unnormalized marginal log-probabilities of hidden states.
Use this method only if you know what you are doing.
"""
# approximate this SRBM with an RBM
rbm = RBM(self.X.shape[0], self.Y.shape[0])
rbm.W = self.W
rbm.b = self.b
rbm.c = self.c
# allocate memory
Q = np.asmatrix(np.zeros([num_is_samples, Y.shape[1]]))
for k in range(num_is_samples):
# draw importance samples
X = rbm.backward(Y)
# store importance weights
Q[k, :] = self._ulogprob(X, Y) - rbm._clogprob_vis_hid(X, Y)
# average importance weights to get estimates
return utils.logmeanexp(Q, 0)