提交 a75e306c authored 作者: Ian Goodfellow's avatar Ian Goodfellow

Removed zeroing of consider_constant's gradient

上级 9505d71a
...@@ -487,10 +487,6 @@ def grad(cost, wrt, g_cost=None, consider_constant=None, ...@@ -487,10 +487,6 @@ def grad(cost, wrt, g_cost=None, consider_constant=None,
grad_dict[cost] = g_cost grad_dict[cost] = g_cost
# the gradient of the constants is 0
for const in consider_constant:
grad_dict[const] = DisconnectedType()()
# variables that do not influence the cost have zero gradient. # variables that do not influence the cost have zero gradient.
# if wrt is such a variable, populate the grad_dict with this info # if wrt is such a variable, populate the grad_dict with this info
# so that wrt not being in var_to_node_to_idx won't cause an error below # so that wrt not being in var_to_node_to_idx won't cause an error below
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论