Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A9943200D2B for ; Thu, 19 Oct 2017 02:40:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A80A0160BEB; Thu, 19 Oct 2017 00:40:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C7FA8160BEA for ; Thu, 19 Oct 2017 02:40:39 +0200 (CEST) Received: (qmail 41996 invoked by uid 500); 19 Oct 2017 00:40:38 -0000 Mailing-List: contact dev-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 dev@mxnet.incubator.apache.org Received: (qmail 41984 invoked by uid 99); 19 Oct 2017 00:40:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Oct 2017 00:40:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id DBDEAC419E for ; Thu, 19 Oct 2017 00:40:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.22 X-Spam-Level: X-Spam-Status: No, score=-0.22 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=tkxue-org.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id EooXWLpgs9SO for ; Thu, 19 Oct 2017 00:40:35 +0000 (UTC) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 9AF805FCF4 for ; Thu, 19 Oct 2017 00:40:35 +0000 (UTC) Received: by mail-it0-f54.google.com with SMTP id c3so8425395itc.3 for ; Wed, 18 Oct 2017 17:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tkxue-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=0iJzpz01BXIKc959/fbovS0z008M4GUMNx+vOwPgreo=; b=I8vEeBbf54sbT3YSFBqxwassexE1DG7ZzI0L7kgbOGuhd6Zqhvt9W3/17cmOUe3Jt/ v9VUnn2afJ+73+8hrQsyRJ28fd5hQPKP2rGzVWtIb3oy5953ucYk5VPW5iQz8R0hFLwf +cPVNb3qRKWdb3azKws9IgRWCZSD4ixY7UpGO997X/fBlrJ1JxM28F/CV9gEWizKl+f3 tn058e1gL6OJpm+5VSnu2Qe6gZFq7/XZNxKXIkny27exIJTh2LobbtlvdEkKPGA0jcMh i9xFg34GG8dg6bG31TxPbxhMUjNI1VngLtVh1Inoie1Hten2RCnJ6/wlTIgPSfVlNsiM 5YDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=0iJzpz01BXIKc959/fbovS0z008M4GUMNx+vOwPgreo=; b=hLYjlB6/gUHFyDSO8WrYWByLzTDzV3XF3lRohSFFmSYETLngtCxJqiQlolzi12dZ+5 iwdtoaakmnBUXLkVG3gm58vbNJzo5WfLVdMqghEVRx0zD+tslzK8ScKz9iGVRS2BxCzF Ph+mU3hgB59vFDppxKudcvzWAKKBuKhImS/bmaaPXf/RhTl5vGusjc5m8W+JwQrBiMct JLQuEzI0G+H+e+hHUcNuQcn9AZS5mmZabzgjtxDv2kfxdMqV9VHCj3Qfw9mtHuTmbppb Ab1GsKgLUiXfbRbLelLsyTVhgrpQd3RyP8WOHeMhSNlV8sHkAQLqkmMuJjW8xt13VPVN RR7Q== X-Gm-Message-State: AMCzsaUYeRs1mn1NlXVC/6omCkPjcdvHPAiOWkcW5au9imCSkfY1OVOp AVSLZry5oRd93ZcdqQUn+aux2LHPJzk1ywK3c1dgh5N5 X-Google-Smtp-Source: ABhQp+Q6gefMh0rhv6CZBd3j6LcguYPDb3+e/hpPYqFjsiTB+FyXfjIjvdO07NRWaCmkI5NXwcaqb4wXRSSsbjCzx2k= X-Received: by 10.36.58.85 with SMTP id m82mr260554itm.90.1508373628643; Wed, 18 Oct 2017 17:40:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.151 with HTTP; Wed, 18 Oct 2017 17:40:28 -0700 (PDT) X-Originating-IP: [70.171.227.78] In-Reply-To: References: From: TongKe Xue Date: Wed, 18 Oct 2017 17:40:28 -0700 Message-ID: Subject: Re: mxnet Scala Convolution To: dev@mxnet.incubator.apache.org Content-Type: text/plain; charset="UTF-8" archived-at: Thu, 19 Oct 2017 00:40:40 -0000 Hi Rahul, Thanks for explaining the high level design + pointing to the implementation details. Besides reading the C++ code and mentally translating the Scala calls, is there a way to get a list of all generated Scala functions? I have looked at: 1. https://mxnet.incubator.apache.org/api/scala/symbol.html shows a few examples, but is not exhaustive 2. https://mxnet.incubator.apache.org/api/scala/docs/index.html#ml.dmlc.mxnet.Symbol appears more comprehensive, but I find neither Convolution nor Softmax there. More specifically, my question is: nnvm adds a bunch of Scala bindings to C++ code. How do I get a list of all these bindings (name, type of inputs, type of output). Thanks! --TongKe On Wed, Oct 18, 2017 at 5:28 PM, Rahul Huilgol wrote: > Hi TongKe, > > These are operators defined in the c++ backend under src/operator. For > example convolution is here > https://github.com/apache/incubator-mxnet/blob/master/src/operator/convolution.cc > . The operators are registered using nnvm, which helps automatically > generate the frontend functions. > > This tutorial on how to add a backend operator > > contains information on how to register such operators, which would help > you understand the above file. > An excerpt from there (for quadratic operator) : "If you use python, when > you type import mxnet as mx, two python functions for invoking your backend > implementation are generated on the fly: one is for imperative programming > registered as mxnet.ndarray.quadratic or mx.nd.quadratic for short; the > other one is for symbolic programming registered under module > mxnet.symbol.quadratic or mx.sym.quadratic for short." > > I'd think the Scala package works similarly. > > Regards, > Rahul > > > > > On Wed, Oct 18, 2017 at 5:06 PM, TongKe Xue wrote: > >> My earlier question was a bit messy. >> >> To rephrase my question: >> >> 1. Scala AlexNet sample code calls Symbol.Convolution: >> >> https://github.com/apache/incubator-mxnet/blob/master/ >> scala-package/examples/src/main/scala/ml/dmlc/mxnetexamples/visualization/ >> AlexNet.scala#L30 >> >> 2. Symbol.scala does not contain the string "Convolution" >> >> https://github.com/apache/incubator-mxnet/blob/master/ >> scala-package/core/src/main/scala/ml/dmlc/mxnet/Symbol.scala#L982 >> >> Question: where/how is Symbol.Convolution defined? >> >> On Wed, Oct 18, 2017 at 4:10 PM, TongKe Xue wrote: >> > Hi, >> > >> > I am reading: https://mxnet.incubator.apache.org/api/scala/symbol.html >> > >> > I see Symbol.Variable, Symbol.Convolution >> > >> > When I look at Symbol.scala, I see Symbol.Variable at: >> > https://github.com/apache/incubator-mxnet/blob/master/ >> scala-package/core/src/main/scala/ml/dmlc/mxnet/Symbol.scala#L982 >> > >> > However, I can't find where Convolution, SoftMax, FullyConnected, ... >> > are defined. >> > >> > Where are these Symbols defined? >> > >> > (I have also tried: grep "Convolution" . -R | grep scala | grep def -- >> > but found nothing). >> > >> > Thanks, >> > --TongKe >> > > > > -- > Rahul Huilgol