Return-Path: X-Original-To: apmail-singa-dev-archive@minotaur.apache.org Delivered-To: apmail-singa-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0FB0118411 for ; Fri, 1 Jan 2016 12:30:05 +0000 (UTC) Received: (qmail 14772 invoked by uid 500); 1 Jan 2016 12:30:04 -0000 Delivered-To: apmail-singa-dev-archive@singa.apache.org Received: (qmail 14744 invoked by uid 500); 1 Jan 2016 12:30:04 -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 14734 invoked by uid 99); 1 Jan 2016 12:30:04 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jan 2016 12:30:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 413D4C028D for ; Fri, 1 Jan 2016 12:30:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.247 X-Spam-Level: * X-Spam-Status: No, score=1.247 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.554, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ptmE3Oiax-zA for ; Fri, 1 Jan 2016 12:29:51 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id A96B72304B for ; Fri, 1 Jan 2016 12:29:40 +0000 (UTC) Received: (qmail 14147 invoked by uid 99); 1 Jan 2016 12:29:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jan 2016 12:29:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 526562C1F7E for ; Fri, 1 Jan 2016 12:29:40 +0000 (UTC) Date: Fri, 1 Jan 2016 12:29:40 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: dev@singa.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SINGA-81) Add Python Helper, which enables users to construct a model (JobProto) and run Singa in Python MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SINGA-81?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15076294#comment-15076294 ] ASF subversion and git services commented on SINGA-81: ------------------------------------------------------ Commit 9ff176c304efddb9169d20f7c213be9c222edf17 in incubator-singa's branch refs/heads/master from chonho [ https://git-wip-us.apache.org/repos/asf?p=incubator-singa.git;h=9ff176c ] SINGA-81 Add Python Helper - Revise src/driver.cc to skip the case of no conf file - Change import path for datasets in example python codes - Format python codes and Add license message - Update README.md > Add Python Helper, which enables users to construct a model (JobProto) and run Singa in Python > ---------------------------------------------------------------------------------------------- > > Key: SINGA-81 > URL: https://issues.apache.org/jira/browse/SINGA-81 > Project: Singa > Issue Type: New Feature > Reporter: Lee Chonho > > Proposed design v1 > - (1) have a class named Builder > * (2) use Boost::parameter library (+ associated necessary header files) > (1) > Builder class implements api-like functions to configure JobProto including NetProto (LayerProto), ClusterProto, UpdaterProto, etc. > Two options > a. users call Builder's functions in main.cc like > {code} > JobProto jobproto; > Builder builder( &jobproto, "job name" ); > builder.xxx(xxx) // add data layer > builder.xxx(xxx) // add parser layer > ... etc. ... > {code} > b. we set main.cc like below and users call Builders functions in Construct() > {code} > JobProto jobproto; > Builder builder( &jobproto, "model name" ); > builder.Construct() > {code} > (2) > Planning to use header-only files from Boost library > - if the necessary files are small enough > - because we can use "named arguments" feature with no restriction of # of arguments, order, types. > - because function will be intuitive, and adding users' own proto in a straightforward way. > Example is here. http://theboostcpplibraries.com/boost.parameter > By following the example, we can do like > {code} > BOOST_PARAMETER_MEMBER_FUNCTION( > (char*), AddLayerData, tag, > (required > (type, (int)) (name, (char*)) (src, (char*)) > ) > (optional > (path, (char*), *) (bsize (int) *) > ) ) > { > ... // set values > return name; > } > {code} > Then, users can add a datalayer by > {code} > L1 = builder.AddLayerData(kShardData, "data", null, _path="train_shard", _bsize=1000); > {code} > (TODO) > - make use of google protobuf reflection for efficient parameter setting > - need to avoid multiple calls for adding same/similar layers > Any suggestion, design idea, comments please. -- This message was sent by Atlassian JIRA (v6.3.4#6332)