提交 b58f5a5d authored 作者: Razvan Pascanu's avatar Razvan Pascanu

R operator for softmax

上级 157e4195
......@@ -347,6 +347,13 @@ class Softmax(gof.Op):
sm = softmax(x)
return [softmax_grad(g_sm, sm)]
def R_op(self, inputs, eval_points):
# I think the Jacobian is symmetric so the R_op
# is the same as the grad
if None in eval_points:
return [None]
return self.grad(inputs, eval_points)
def infer_shape(self, node, shape):
return shape
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论