本文整理匯總了Python中cle.cle.cost.Gaussian.sum方法的典型用法代碼示例。如果您正苦於以下問題:Python Gaussian.sum方法的具體用法?Python Gaussian.sum怎麽用?Python Gaussian.sum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cle.cle.cost.Gaussian
的用法示例。
在下文中一共展示了Gaussian.sum方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: cost
# 需要導入模塊: from cle.cle.cost import Gaussian [as 別名]
# 或者: from cle.cle.cost.Gaussian import sum [as 別名]
def cost(self, X):
if len(X) != 3:
raise ValueError("The number of inputs does not match.")
cost = Gaussian(X[0], X[1], X[2])
if self.use_sum:
return cost.sum()
else:
return cost.mean()
示例2: Gaussian
# 需要導入模塊: from cle.cle.cost import Gaussian [as 別名]
# 或者: from cle.cle.cost.Gaussian import sum [as 別名]
k.default_update = v
s_t = s_t[:-1]
s_shape = s_t.shape
s_in = T.concatenate([s_0, s_t.reshape((s_shape[0]*s_shape[1], -1))], axis=0)
theta_1_in = theta_1.fprop([s_in])
theta_2_in = theta_2.fprop([theta_1_in])
theta_3_in = theta_3.fprop([theta_2_in])
theta_4_in = theta_4.fprop([theta_3_in])
theta_mu_in = theta_mu.fprop([theta_4_in])
theta_sig_in = theta_sig.fprop([theta_4_in])
recon = Gaussian(x_in, theta_mu_in, theta_sig_in)
recon = recon.reshape((x_shape[0], x_shape[1]))
recon = recon * x_mask
recon_term = recon.sum(axis=0).mean()
recon_term.name = 'nll'
max_x = x.max()
mean_x = x.mean()
min_x = x.min()
max_x.name = 'max_x'
mean_x.name = 'mean_x'
min_x.name = 'min_x'
max_theta_mu = theta_mu_in.max()
mean_theta_mu = theta_mu_in.mean()
min_theta_mu = theta_mu_in.min()
max_theta_mu.name = 'max_theta_mu'
mean_theta_mu.name = 'mean_theta_mu'
min_theta_mu.name = 'min_theta_mu'