From commits-return-87415-archive-asf-public=cust-asf.ponee.io@mxnet.incubator.apache.org Sat Jun 1 18:09:34 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id C061418061A for ; Sat, 1 Jun 2019 20:09:33 +0200 (CEST) Received: (qmail 59879 invoked by uid 500); 1 Jun 2019 18:09:33 -0000 Mailing-List: contact commits-help@mxnet.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mxnet.incubator.apache.org Delivered-To: mailing list commits@mxnet.incubator.apache.org Received: (qmail 59870 invoked by uid 99); 1 Jun 2019 18:09:33 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Jun 2019 18:09:33 +0000 From: GitBox To: commits@mxnet.apache.org Subject: [GitHub] [incubator-mxnet] kshitij12345 commented on a change in pull request #15120: [bug] fix higher grad log Message-ID: <155941257310.24049.15818624993469583105.gitbox@gitbox.apache.org> Date: Sat, 01 Jun 2019 18:09:33 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit kshitij12345 commented on a change in pull request #15120: [bug] fix higher grad log URL: https://github.com/apache/incubator-mxnet/pull/15120#discussion_r289614132 ########## File path: src/operator/tensor/elemwise_unary_op_basic.cc ########## @@ -1074,16 +1074,19 @@ MXNET_OPERATOR_REGISTER_BINARY_WITH_SPARSE_CPU_DR(_backward_log, [](const nnvm::NodePtr& n, const std::vector& ograds) { // For f(x) -> f = log // f''(x) = -1 * (f'(x) * f'(x)) - auto gx = nnvm::NodeEntry{n}; + auto gx_mul_head_grads = nnvm::NodeEntry{n}; // f'(x) * head_grads + auto head_grads = nnvm::NodeEntry{n->inputs[0]}; + auto g_lx = MakeNode("reciprocal", n->attrs.name + "_backward_log_grad", + {n->inputs[1]}, nullptr, &n); auto ggx_mid = MakeNode("elemwise_mul", n->attrs.name + "_backward_mid_grad_grad", - {gx, gx}, nullptr, &n); + {gx_mul_head_grads, nnvm::NodeEntry{g_lx}}, nullptr, &n); auto ggx = MakeNode("negative", n->attrs.name + "_backward_grad_grad", {nnvm::NodeEntry{ggx_mid}}, nullptr, &n); std::vector ret; ret.emplace_back(MakeNode("elemwise_mul", n->attrs.name + "_backward_grad_grad", - {ograds[0], gx}, nullptr, &n)); + {ograds[0], nnvm::NodeEntry{g_lx}}, nullptr, &n)); Review comment: I am having trouble with `head_grads.grad` which is being returned as `0's` while I expect it to be this. Please help. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services