def l2_decay(self, rate):
rec_l2_cost = T.constant(0.).astype(floatX)
gen_l2_cost = T.constant(0.).astype(floatX)
for l in xrange(self.n_layers):
rec_l2_cost += self.posteriors[l].l2_decay(rate)
gen_l2_cost += self.conditionals[l].l2_decay(rate)
rval = OrderedDict(
rec_l2_cost=rec_l2_cost,
gen_l2_cost=gen_l2_cost,
cost = rec_l2_cost + gen_l2_cost
)
return rval
# --------------------------------------------------------------------------
评论列表
文章目录