From dev-return-3227-archive-asf-public=cust-asf.ponee.io@singa.incubator.apache.org Fri Aug 9 09:22:45 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 D825718063F for ; Fri, 9 Aug 2019 11:22:44 +0200 (CEST) Received: (qmail 28041 invoked by uid 500); 9 Aug 2019 09:22:44 -0000 Mailing-List: contact dev-help@singa.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@singa.incubator.apache.org Delivered-To: mailing list dev@singa.incubator.apache.org Received: (qmail 28030 invoked by uid 99); 9 Aug 2019 09:22:44 -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; Fri, 09 Aug 2019 09:22:44 +0000 From: GitBox To: dev@singa.apache.org Subject: [GitHub] [incubator-singa] nudles commented on a change in pull request #488: SINGA -475 add Sign operator to singa Message-ID: <156534256413.30658.11349859515955156809.gitbox@gitbox.apache.org> Date: Fri, 09 Aug 2019 09:22:44 -0000 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit nudles commented on a change in pull request #488: SINGA -475 add Sign operator to singa URL: https://github.com/apache/incubator-singa/pull/488#discussion_r312397599 ########## File path: python/singa/autograd.py ########## @@ -1828,3 +1828,21 @@ def backward(self, dy): def leakyrelu(x, a=0.01): return LeakyRelu(a)(x)[0] + + +class Sign(Operation): + def __init__(self): + super(Sign, self).__init__() + + def forward(self, a): + if training: + self.input = a + return singa.Sign(a) + + def backward(self, dy): + dx = singa.MultFloat(dy, 0.0) Review comment: the dx is always 0? ---------------------------------------------------------------- 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