Skip to content

Commit

Permalink
fix sum
Browse files Browse the repository at this point in the history
  • Loading branch information
WellyZhang committed Nov 14, 2016
1 parent bb007e8 commit ddc09a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ddpg.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def init_net(self):
qval_sym = loss_symbols["qval"]
yval_sym = loss_symbols["yval"]
weight_sym_dict = loss_symbols["weight"]
reg = self.qfunc_weight_decay * 0.5 * mx.symbol.sum(
reg = self.qfunc_weight_decay * 0.5 * sum(
[mx.symbol.sum(mx.symbol.square(arr))
for name, arr in weight_sym_dict.items()])
loss = 1.0 / self.batch_size * mx.symbol.sum(
Expand Down Expand Up @@ -108,7 +108,7 @@ def init_net(self):
loss_symbols = self.policy.get_loss_symbols()
act_sym = loss_symbols["act"]
weight_sym_dict = loss["weight"]
reg = self.policy_weight_decay * 0.5 * mx.symbol.sum(
reg = self.policy_weight_decay * 0.5 * sum(
[mx.symbol.sum(mx.symbol.square(arr))
for name, arr in weight_sym_dict.items()])
policy_qval = qval_sym
Expand Down

0 comments on commit ddc09a7

Please sign in to comment.