本文整理汇总了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'