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 057B12004A0 for ; Wed, 16 Aug 2017 17:30:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 03622168DF0; Wed, 16 Aug 2017 15:30:59 +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 21164168DED for ; Wed, 16 Aug 2017 17:30:57 +0200 (CEST) Received: (qmail 8750 invoked by uid 500); 16 Aug 2017 15:30:57 -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 8734 invoked by uid 99); 16 Aug 2017 15:30:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 16 Aug 2017 15:30:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 879691A1925 for ; Wed, 16 Aug 2017 15:30:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.401 X-Spam-Level: X-Spam-Status: No, score=-0.401 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 3Ax3WTwnSkBB for ; Wed, 16 Aug 2017 15:30:54 +0000 (UTC) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com [209.85.128.178]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id CF0C95F5F7 for ; Wed, 16 Aug 2017 15:30:53 +0000 (UTC) Received: by mail-wr0-f178.google.com with SMTP id y96so15979316wrc.1 for ; Wed, 16 Aug 2017 08:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ZGNz9EgrLwCwLIzT/K6lbTly2ikyTg5eE+z6vyzyGEc=; b=CTckQobwzW2Vg/6BnOSoQKGLNA0lMusg2dzjwQd8XPUlqvvPgpI3GbB0BbbHKqv+zW IWhjxSDG3Bvim8+KsxSl2zFH7opGrSzfBpeffCQqIadZ38legF7TYKzlWpy0x6gQP4VH AVtYROI5MXto05Ip/Xkryuk61cdrLuntW/lp30VwxtVC4q6b84Pwjr/mjfkHgnm+9fYC VASgRHHbcdXLotuwuuL/Pz+EfpyhdVsOG6qkPHxEx2rsOCRIQ2jpg4i0Tb0EibsOL8aj DfIDxVS57rUzCfPHySg2eIb0ArmMzxnb2o6T6Zg2P+AqlOizrtaLQfOQaZMUfbuB+JOQ RTtw== 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=ZGNz9EgrLwCwLIzT/K6lbTly2ikyTg5eE+z6vyzyGEc=; b=giktamIhXkJ9Eo9uSh+4cWl4chazodT7cK8yWT+ZNIp2WCmjTzcqmkox8qiz1DObUq 13MMLPMkdjQ+nrU2fqFDw5rGQYl/+nTGdfz2THmfaMK8B73bJCf2pD9IAzgbKtirBJRL V91alELxssvmcPSK6JZn2rzuwe7iph+Grlm1mXzR03pr6Y21NjVLMdNMAHtSrYJuhTly lini4Qbw6AKnM8Fe8l43OxqvJl9G5naFTIibiYJW45ru6UTVzzgY+0UE2nUq95yXWM4b Cs5+qH2+SOaMRmVEAHZ+wX4JJzBbePERBHXFamP30yvqHVrwlsMIrlcuhjeKYjYxtMOg L6oQ== X-Gm-Message-State: AHYfb5ixMUiLkhTX8RT9S97xQuF1cFrCUHp1ZUyGBeZsutivB8YXFsIz NbyJQ/YgujopWOY+xFlTOLf+JLvBfy4Q X-Received: by 10.80.194.82 with SMTP id t18mr2315669edf.113.1502897452716; Wed, 16 Aug 2017 08:30:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.184.76 with HTTP; Wed, 16 Aug 2017 08:30:52 -0700 (PDT) In-Reply-To: References: From: Nan Zhu Date: Wed, 16 Aug 2017 08:30:52 -0700 Message-ID: Subject: Re: Java API for MXNet To: dev@mxnet.incubator.apache.org Content-Type: multipart/alternative; boundary="94eb2c1cda22cd96b60556e09450" archived-at: Wed, 16 Aug 2017 15:30:59 -0000 --94eb2c1cda22cd96b60556e09450 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I agree with Yizhi My major concern is the duplicate implementations, which are usually one of the major sources of bugs, especially with two languages which are naturally interactive (OK, Calling Scala from Java might need some more efforts). It is just like we provide C++ & C APIs of MxNet in two separated packages. About dependency problem, when you say "As far as I see this has the great disadvantage that the Java API would force Scala as a dependency onto the java users.", would you please give a concrete example causing critical issues? Best, Nan On Wed, Aug 16, 2017 at 8:19 AM, YiZhi Liu wrote: > Hi, > > If we build the Java API from the very beginning, i.e. the JNI part, > we have to rewrite the codes for training, predict, inferShape, etc. > It would be too heavy to maintain a totally new front language. > > As far as I see, I don't think Scala library dependency would be a big > problem in most cases, unless we are going to use it in embedded > devices. Could you illustrate some use-cases where you cannot involve > Scala dependencies? > > 2017-08-16 22:13 GMT+08:00 Joern Kottmann : > > Hello, > > > > the approach which is taken by Spark is described here [1]. > > > > As far as I see this has the great disadvantage that the Java API > > would force Scala as a dependency onto the java users. > > For a library it is always a great advantage if it doesn't have many > > dependencies, or zero dependencies. In our case it could be quite > > realistic to have a thin wrapper around the C API without needing any > > other dependencies (or only dependencies which can't be avoided). > > > > The JNI layer could easily be shared between the Java and Scala API. > > As far as I understand is the JNI layer in the Scala API anyway > > private and a change to it wouldn't require that the public part of > > the Scala API is changed. > > > > What do you think? > > > > J=C3=B6rn > > > > [1] https://cwiki.apache.org/confluence/display/SPARK/Java+API+Internal= s > > > > On Wed, Aug 16, 2017 at 3:39 PM, YiZhi Liu wrote: > >> Hi Joern, > >> > >> I suggest to build Java API as a wrapper of Scala API, re-use most of > >> the procedures. Referring to the Java API in Apache Spark. > >> > >> 2017-08-16 18:21 GMT+08:00 Joern Kottmann : > >>> Hello all, > >>> > >>> I would like to propose the addition of a Java API to MXNet. > >>> > >>> There has been some previous work done for the Scala API, and it make= s > >>> sense to at least share the JNI layer between the two. > >>> > >>> The Java API probably should be aligned with the Python API (and > >>> others which exist already) with a few changes to give it a native > >>> Java feel. > >>> > >>> As far as I understand there are multiple people interested to work o= n > >>> this and it would be good to maybe come up with a written proposal on > >>> how things should be. > >>> > >>> My motivation is to get a Java API which can be used by Apache OpenNL= P > >>> to solve various NLP tasks using Deep Learning based approaches and I > >>> am also interested to work on MXNet. > >>> > >>> J=C3=B6rn > >> > >> > >> > >> -- > >> Yizhi Liu > >> DMLC member > >> Technical Manager > >> Qihoo 360 Inc, Shanghai, China > > > > -- > Yizhi Liu > DMLC member > Technical Manager > Qihoo 360 Inc, Shanghai, China > --94eb2c1cda22cd96b60556e09450--