Return-Path: X-Original-To: apmail-singa-commits-archive@minotaur.apache.org Delivered-To: apmail-singa-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC5F218503 for ; Wed, 20 Apr 2016 05:12:25 +0000 (UTC) Received: (qmail 13438 invoked by uid 500); 20 Apr 2016 05:12:25 -0000 Delivered-To: apmail-singa-commits-archive@singa.apache.org Received: (qmail 13407 invoked by uid 500); 20 Apr 2016 05:12:25 -0000 Mailing-List: contact commits-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 commits@singa.incubator.apache.org Received: (qmail 13386 invoked by uid 99); 20 Apr 2016 05:12:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Apr 2016 05:12:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 86263180BA6 for ; Wed, 20 Apr 2016 05:12:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.799 X-Spam-Level: * X-Spam-Status: No, score=1.799 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id KKfz0A08Cqj0 for ; Wed, 20 Apr 2016 05:12:12 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTP id 4280A5F3A1 for ; Wed, 20 Apr 2016 05:12:12 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 86809E0223 for ; Wed, 20 Apr 2016 05:12:11 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 0F6DD3A0470 for ; Wed, 20 Apr 2016 05:12:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r986140 [2/34] - in /websites/staging/singa/trunk/content: ./ community/ develop/ docs/ docs/jp/ docs/kr/ docs/zh/ releases/ v0.1.0/ v0.2.0/ v0.2.0/jp/ v0.2.0/kr/ v0.2.0/zh/ v0.3.0/ v0.3.0/jp/ v0.3.0/kr/ v0.3.0/zh/ Date: Wed, 20 Apr 2016 05:12:08 -0000 To: commits@singa.incubator.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160420051211.0F6DD3A0470@svn01-us-west.apache.org> Modified: websites/staging/singa/trunk/content/docs/kr/cnn.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/cnn.html (original) +++ websites/staging/singa/trunk/content/docs/kr/cnn.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – CNN Example Modified: websites/staging/singa/trunk/content/docs/kr/code-structure.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/code-structure.html (original) +++ websites/staging/singa/trunk/content/docs/kr/code-structure.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Code Structure Modified: websites/staging/singa/trunk/content/docs/kr/communication.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/communication.html (original) +++ websites/staging/singa/trunk/content/docs/kr/communication.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Communication Modified: websites/staging/singa/trunk/content/docs/kr/data.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/data.html (original) +++ websites/staging/singa/trunk/content/docs/kr/data.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 데이터 준비 Modified: websites/staging/singa/trunk/content/docs/kr/debug.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/debug.html (original) +++ websites/staging/singa/trunk/content/docs/kr/debug.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – How to Debug Modified: websites/staging/singa/trunk/content/docs/kr/distributed-training.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/distributed-training.html (original) +++ websites/staging/singa/trunk/content/docs/kr/distributed-training.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 분산 트레이닝 Modified: websites/staging/singa/trunk/content/docs/kr/docker.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/docker.html (original) +++ websites/staging/singa/trunk/content/docs/kr/docker.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Building SINGA Docker container Modified: websites/staging/singa/trunk/content/docs/kr/examples.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/examples.html (original) +++ websites/staging/singa/trunk/content/docs/kr/examples.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Example Models Modified: websites/staging/singa/trunk/content/docs/kr/frameworks.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/frameworks.html (original) +++ websites/staging/singa/trunk/content/docs/kr/frameworks.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 분산 트레이닝 Modified: websites/staging/singa/trunk/content/docs/kr/index.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/index.html (original) +++ websites/staging/singa/trunk/content/docs/kr/index.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 최신 문서 Modified: websites/staging/singa/trunk/content/docs/kr/installation.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/installation.html (original) +++ websites/staging/singa/trunk/content/docs/kr/installation.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 인스톨 Modified: websites/staging/singa/trunk/content/docs/kr/installation_source.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/installation_source.html (original) +++ websites/staging/singa/trunk/content/docs/kr/installation_source.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Building SINGA from source Modified: websites/staging/singa/trunk/content/docs/kr/layer.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/layer.html (original) +++ websites/staging/singa/trunk/content/docs/kr/layer.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Layers Modified: websites/staging/singa/trunk/content/docs/kr/lmdb.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/lmdb.html (original) +++ websites/staging/singa/trunk/content/docs/kr/lmdb.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Modified: websites/staging/singa/trunk/content/docs/kr/mesos.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/mesos.html (original) +++ websites/staging/singa/trunk/content/docs/kr/mesos.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Distributed Training on Mesos Modified: websites/staging/singa/trunk/content/docs/kr/mlp.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/mlp.html (original) +++ websites/staging/singa/trunk/content/docs/kr/mlp.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – MLP Example Modified: websites/staging/singa/trunk/content/docs/kr/model-config.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/model-config.html (original) +++ websites/staging/singa/trunk/content/docs/kr/model-config.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Model Configuration Modified: websites/staging/singa/trunk/content/docs/kr/neural-net.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/neural-net.html (original) +++ websites/staging/singa/trunk/content/docs/kr/neural-net.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Neural Net Modified: websites/staging/singa/trunk/content/docs/kr/neuralnet-partition.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/neuralnet-partition.html (original) +++ websites/staging/singa/trunk/content/docs/kr/neuralnet-partition.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Neural Net Partition Modified: websites/staging/singa/trunk/content/docs/kr/overview.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/overview.html (original) +++ websites/staging/singa/trunk/content/docs/kr/overview.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 개요 Modified: websites/staging/singa/trunk/content/docs/kr/param.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/param.html (original) +++ websites/staging/singa/trunk/content/docs/kr/param.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Parameters Modified: websites/staging/singa/trunk/content/docs/kr/programmer-guide.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/programmer-guide.html (original) +++ websites/staging/singa/trunk/content/docs/kr/programmer-guide.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Programmer Guide Modified: websites/staging/singa/trunk/content/docs/kr/programming-guide.html ============================================================================== --- websites/staging/singa/trunk/content/docs/kr/programming-guide.html (original) +++ websites/staging/singa/trunk/content/docs/kr/programming-guide.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 프로그래밍 가이드 @@ -342,7 +342,7 @@
./bin/singa-run.sh -conf <path to job conf> [-resume]
 
-

-resume 는 트레이닝을 저번 checkpoint 부터 다시 계속할때 쓰는 인수 입니다. MLPCNN 샘플들은 built-in 컴포넌트를 쓰고 있습니다. Please read the corresponding pages for their job configuration files. The subsequent pages will illustrate the details on each component of the configuration.

+

-resume 는 저번 checkpoint 부터 다시 트레이닝을 계속할때 쓰는 인수 입니다. MLPCNN 샘플들은 built-in 컴포넌트를 이용하고 있습니다. Please read the corresponding pages for their job configuration files. The subsequent pages will illustrate the details on each component of the configuration.

Advanced 유저 가이드

If a user’s model contains some user-defined components, e.g., Updater, he has to write a main function to register these components. It is similar to Hadoop’s main function. Generally, the main function should

@@ -383,8 +383,9 @@ int main(int argc, char** argv) { }

Driver class’ Init method 는 커맨드라인 인수 -conf <job conf> 에서 주어진 job configuration 파일을 읽습니다. 그 파일에는 cluster topology 정보가 기술 되어있고, 유저가 neural net, updater 등을 업데이트 혹은 설정 하기위한 jobConf를 리턴합니다. 유저가 Layer, Updater, Worker, Param 등의 subclass를 정의하면, driver 에 등록을 해야합니다. 트레이닝을 시작하기 위하여 job configuration 즉 jobConf를 driver.Train 에 넘겨줍니다.

-

We will provide helper functions to make the configuration easier in the future, like keras.

-

Users need to compile and link their code (e.g., layer implementations and the main file) with SINGA library (.libs/libsinga.so) to generate an executable file, e.g., with name mysinga. To launch the program, users just pass the path of the mysinga and base job configuration to ./bin/singa-run.sh.

+ +

유저코드를 compile 하고 SINGA library (.libs/libsinga.so) 와 링크시켜 실행파일, e.g., mysinga, 을 생성합니다. 프로그램은 다음과 같이 실행합니다.

./bin/singa-run.sh -conf <path to job conf> -exec <path to mysinga> [other arguments]

Modified: websites/staging/singa/trunk/content/docs/kr/quick-start.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/kr/quick-start.html (original)
+++ websites/staging/singa/trunk/content/docs/kr/quick-start.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – 퀵 스타트
     

Modified: websites/staging/singa/trunk/content/docs/kr/rbm.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/kr/rbm.html (original)
+++ websites/staging/singa/trunk/content/docs/kr/rbm.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – RBM Example
     

Modified: websites/staging/singa/trunk/content/docs/kr/rnn.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/kr/rnn.html (original)
+++ websites/staging/singa/trunk/content/docs/kr/rnn.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Recurrent Neural Networks for Language Modelling
     

Modified: websites/staging/singa/trunk/content/docs/kr/test.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/kr/test.html (original)
+++ websites/staging/singa/trunk/content/docs/kr/test.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Performance Test and Feature Extraction
     

Modified: websites/staging/singa/trunk/content/docs/kr/train-one-batch.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/kr/train-one-batch.html (original)
+++ websites/staging/singa/trunk/content/docs/kr/train-one-batch.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Train-One-Batch
     

Modified: websites/staging/singa/trunk/content/docs/kr/updater.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/kr/updater.html (original)
+++ websites/staging/singa/trunk/content/docs/kr/updater.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Updater
     

Modified: websites/staging/singa/trunk/content/docs/layer.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/layer.html (original)
+++ websites/staging/singa/trunk/content/docs/layer.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Layers
     

Modified: websites/staging/singa/trunk/content/docs/lmdb.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/lmdb.html (original)
+++ websites/staging/singa/trunk/content/docs/lmdb.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – 
     

Modified: websites/staging/singa/trunk/content/docs/mesos.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/mesos.html (original)
+++ websites/staging/singa/trunk/content/docs/mesos.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Distributed Training on Mesos
     

Modified: websites/staging/singa/trunk/content/docs/mlp.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/mlp.html (original)
+++ websites/staging/singa/trunk/content/docs/mlp.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – MLP Example
     

Modified: websites/staging/singa/trunk/content/docs/model-config.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/model-config.html (original)
+++ websites/staging/singa/trunk/content/docs/model-config.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Model Configuration
     

Modified: websites/staging/singa/trunk/content/docs/neural-net.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/neural-net.html (original)
+++ websites/staging/singa/trunk/content/docs/neural-net.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Neural Net
     

Modified: websites/staging/singa/trunk/content/docs/neuralnet-partition.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/neuralnet-partition.html (original)
+++ websites/staging/singa/trunk/content/docs/neuralnet-partition.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Neural Net Partition
     

Modified: websites/staging/singa/trunk/content/docs/overview.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/overview.html (original)
+++ websites/staging/singa/trunk/content/docs/overview.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Introduction
     

Modified: websites/staging/singa/trunk/content/docs/param.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/param.html (original)
+++ websites/staging/singa/trunk/content/docs/param.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Parameters
     

Modified: websites/staging/singa/trunk/content/docs/programming-guide.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/programming-guide.html (original)
+++ websites/staging/singa/trunk/content/docs/programming-guide.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Programming Guide
     

Modified: websites/staging/singa/trunk/content/docs/python.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/python.html (original)
+++ websites/staging/singa/trunk/content/docs/python.html Wed Apr 20 05:12:03 2016
@@ -1,13 +1,13 @@
 
 
 
   
     
     
-    
+    
     
     Apache SINGA – Python Binding
     
@@ -321,7 +321,7 @@
                                   
             

Python Binding


-

Python binding provides APIs for configuring a training job following keras, including the configuration of neural net, training algorithm, etc. It replaces the configuration file (e.g., job.conf) in protobuf format, which is typically long and error-prone to prepare. In later version, we will add python functions to interact with the layer and neural net objects, which would enable users to train and debug their models interactively.

+

Python binding provides APIs for configuring a training job following keras, including the configuration of neural net, training algorithm, etc. It replaces the configuration file (e.g., job.conf) in protobuf format, which is typically long and error-prone to prepare. We will add python functions to interact with the layer and neural net objects (see here), which would enable users to train and debug their models interactively.

Here is the layout of python related code,

@@ -373,11 +373,11 @@ bin/singa-run.sh -exec tool/python/examp m = Sequential('mlp', sys.argv) -m.add(Dense(2500, init='uniform', activation='tanh')) -m.add(Dense(2000, init='uniform', activation='tanh')) -m.add(Dense(1500, init='uniform', activation='tanh')) -m.add(Dense(1000, init='uniform', activation='tanh')) -m.add(Dense(500, init='uniform', activation='tanh')) +m.add(Dense(2500, init='uniform', activation='stanh')) +m.add(Dense(2000, init='uniform', activation='stanh')) +m.add(Dense(1500, init='uniform', activation='stanh')) +m.add(Dense(1000, init='uniform', activation='stanh')) +m.add(Dense(500, init='uniform', activation='stanh')) m.add(Dense(10, init='uniform', activation='softmax')) sgd = SGD(lr=0.001, lr_type='step') Added: websites/staging/singa/trunk/content/docs/python_interactive_training.html ============================================================================== --- websites/staging/singa/trunk/content/docs/python_interactive_training.html (added) +++ websites/staging/singa/trunk/content/docs/python_interactive_training.html Wed Apr 20 05:12:03 2016 @@ -0,0 +1,512 @@ + + + + + + + + + Apache SINGA – Interactive Training using Python + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Fork me on GitHub + + + + + + + +
+ +
+ + + + + +
+
+ +
+ + +
+ +

Interactive Training using Python

+
+

Layer class (layer.py) has the following methods for an interactive training. For the basic usage of Python binding features, please refer to python.md.

+

ComputeFeature(self, *srclys)

+ +
    + +
  • +

    This method creates and sets up singa::Layer and maintains its source layers, then call singa::Layer::ComputeFeature(…) for data transformation.

    + +
      + +
    • *srclys: (an arbtrary number of) source layers
    • +
  • +
+

ComputeGradient(self)

+ +
    + +
  • This method creates calls singa::Layer::ComputeGradient(…) for gradient computation.
  • +
+

GetParams(self)

+ +
    + +
  • This method calls singa::Layer::GetParam() to retrieve parameter values of the layer. Currently, it returns weight and bias. Each parameter is a 2D numpy array.
  • +
+

SetParams(self, *params)

+ +
    + +
  • This method sets parameter values of the layer. + +
      + +
    • *params: (an arbitrary number of) parameters, each of which is a 2D numpy array. Typically, it sets weight and bias, 2D numpy array.
    • +
  • +
+
+

Dummy class is a subclass of Layer, which is provided to fetch input data and/or label information. Specifically, it creates singa::DummyLayer.

+

Feed(self, shape, data, aux_data)

+ +
    + +
  • +

    This method sets input data and/or auxiary data such as labels.

    + +
      + +
    • shape: the shape (width and height) of dataset
    • + +
    • data: input dataset
    • + +
    • aux_data: auxiary dataset (e.g., labels)
    • +
  • +
+

In addition, Dummy class has two subclasses named ImageInput and LabelInput.

+ +
    + +
  • +

    ImageInput class will take three arguments as follows.

    +

    __init__(self, height=None, width=None, nb_channel=1)

  • + +
  • +

    Both ImageInput and LabelInput classes have their own Feed method to call Feed of Dummy class.

    +

    Feed(self, data)

  • +
+ +
+
+

Example scripts for the interactive training

+

Two example scripts are provided at train_mnist.py and train_cifar10.py, one is training MLP model for MNIST dataset, and another is training CNN model for CIFAR10 dataset.

+ +
    + +
  • +

    Assume that nn is a neural network model, i.e., a list of layers. Currently, this examples considers sequential models. Example MLP and CNN are shown below.

  • + +
  • +

    load_dataset() method loads input data and corresponding labels, each of which is a 2D numpy array. For example, loading MNIST dataset returns x: [60000 x 784] and y: [60000 x 1]. Loading CIFAR10 dataset, x: [10000 x 3072] and y: [10000 x 1].

  • + +
  • +

    sgd is an Updater instance. Please see python.md and model.py for more details.

  • +
+
+
+

Basic steps for the interactive training

+ +
    + +
  • +

    Step 1: Prepare batchsized data and corresponding label information, and then input the data using Feed() method.

  • + +
  • +

    Step 2: (a) Transform data according to neuralnet (nn) structure using ComputeFeature(). Note that this example considers a sequential model, so it uses a simple loop. (b) Users need to provide label information for loss layer to compute loss function. (c) Users can print out the training performance, e.g., loss and accuracy.

  • + +
  • +

    Step 3: Compute gradient in a reverse order of neuralnet (nn) structure using ComputeGradient().

  • + +
  • +

    Step 4: Update parameters, e.g., weight and bias, of layers using Update() of the updater.

  • +
+

Here is an example script for the interactive training. ``` bsize = 64 # batchsize disp_freq = 10 # step to show the training accuracy

+

x, y = load_dataset()

+

for i in range(x.shape[0] / bsize):

+ +
+
# (Step1) Input data containing "bsize" samples
+xb, yb = x[i*bsize:(i+1)*bsize, :], y[i*bsize:(i+1)*bsize, :]
+nn[0].Feed(xb)
+label.Feed(yb)
+
+# (Step2-a) Transform data according to the neuralnet (nn) structure
+for h in range(1, len(nn)):
+    nn[h].ComputeFeature(nn[h-1])
+
+# (Step2-b) Provide label to compute loss function
+loss.ComputeFeature(nn[-1], label)
+
+# (Step2-c) Print out performance, e.g., loss and accuracy
+if (i+1) % disp_freq == 0:
+    print '  Step {:>3}: '.format(i+1),
+    loss.display()
+
+# (Step3) Compute gradient in a reverse order
+loss.ComputeGradient()
+for h in range(len(nn)-1, 0, -1):
+    nn[h].ComputeGradient()
+    # (Step 4) Update parameter
+    sgd.Update(i+1, nn[h])
+
+ +
+
<a id="model"></a>
+### <a href="#model">Example MLP</a>  
+
+Here is an example MLP model with 5 fully-connected hidden layers.
+Please refer to [`python.md`](python.md) and [`layer.py`]() for more details about layer definition. `SGD()` is an updater defined in [`model.py`]().
+
+
+

input = ImageInput(28, 28) # image width and height label = LabelInput()

+

nn = [] nn.append(input) nn.append(Dense(2500, init=‘uniform’)) nn.append(Activation(‘stanh’)) nn.append(Dense(2000, init=‘uniform’)) nn.append(Activation(‘stanh’)) nn.append(Dense(1500, init=‘uniform’)) nn.append(Activation(‘stanh’)) nn.append(Dense(1000, init=‘uniform’)) nn.append(Activation(‘stanh’)) nn.append(Dense(500, init=‘uniform’)) nn.append(Activation(‘stanh’)) nn.append(Dense(10, init=‘uniform’)) loss = Loss(‘softmaxloss’)

+

sgd = SGD(lr=0.001, lr_type=‘step’)

+ +
+
### <a href="#model2">Example CNN</a>  
+
+Here is an example MLP model with 3 convolution and pooling layers.
+Please refer to [`python.md`]() and [`layer.py`]() for more details about layer definition. `SGD()` is an updater defined in [`model.py`]().
+
+
+

input = ImageInput(32, 32, 3) # image width, height, channel label = LabelInput()

+

nn = [] nn.append(input) nn.append(Convolution2D(32, 5, 1, 2, w_std=0.0001, b_lr=2)) nn.append(MaxPooling2D(pool_size=(3,3), stride=2)) nn.append(Activation(‘relu’)) nn.append(LRN2D(3, alpha=0.00005, beta=0.75)) nn.append(Convolution2D(32, 5, 1, 2, b_lr=2)) nn.append(Activation(‘relu’)) nn.append(AvgPooling2D(pool_size=(3,3), stride=2)) nn.append(LRN2D(3, alpha=0.00005, beta=0.75)) nn.append(Convolution2D(64, 5, 1, 2)) nn.append(Activation(‘relu’)) nn.append(AvgPooling2D(pool_size=(3,3), stride=2)) nn.append(Dense(10, w_wd=250, b_lr=2, b_wd=0)) loss = Loss(‘softmaxloss’)

+

sgd = SGD(decay=0.004, momentum=0.9, lr_type=‘manual’, step=(0,60000,65000), step_lr=(0.001,0.0001,0.00001)) ```

+
+
+
+ +
+ +
+
+
+ +

Copyright © 2015 The Apache Software Foundation. All rights reserved. Apache Singa, Apache, the Apache feather logo, and the Apache Singa project logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.

+
+ + +
+
+ + Modified: websites/staging/singa/trunk/content/docs/quick-start.html ============================================================================== --- websites/staging/singa/trunk/content/docs/quick-start.html (original) +++ websites/staging/singa/trunk/content/docs/quick-start.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Quick Start Modified: websites/staging/singa/trunk/content/docs/rbm.html ============================================================================== --- websites/staging/singa/trunk/content/docs/rbm.html (original) +++ websites/staging/singa/trunk/content/docs/rbm.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – RBM Example Modified: websites/staging/singa/trunk/content/docs/rnn.html ============================================================================== --- websites/staging/singa/trunk/content/docs/rnn.html (original) +++ websites/staging/singa/trunk/content/docs/rnn.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Recurrent Neural Networks for Language Modelling Modified: websites/staging/singa/trunk/content/docs/test.html ============================================================================== --- websites/staging/singa/trunk/content/docs/test.html (original) +++ websites/staging/singa/trunk/content/docs/test.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Performance Test and Feature Extraction Modified: websites/staging/singa/trunk/content/docs/train-one-batch.html ============================================================================== --- websites/staging/singa/trunk/content/docs/train-one-batch.html (original) +++ websites/staging/singa/trunk/content/docs/train-one-batch.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Train-One-Batch Modified: websites/staging/singa/trunk/content/docs/updater.html ============================================================================== --- websites/staging/singa/trunk/content/docs/updater.html (original) +++ websites/staging/singa/trunk/content/docs/updater.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Updater @@ -370,6 +370,44 @@ rho: float # [0,1] } } +
+
+

AdaDeltaUpdater

+

It inherits the base Updater to implements the AdaDelta updating algorithm. Its type is kAdaDelta.

+ +
+
updater {
+  type: kAdaDelta
+  adadelta_conf {
+   rho: float # [0,1]
+  }
+}
+
+
+

Adam

+

It inherits the base Updater to implements the Adam updating algorithm. Its type is kAdam. beta1 and beta2 is floats, 0 < beta < 1, generally close to 1.

+ +
+
updater {
+  type: kAdam
+  adam_conf {
+   beta1: float # [0,1]
+   beta2: float # [0,1]
+  }
+}
+
+
+

AdaMax

+

It inherits the base Updater to implements the AdaMax updating algorithm. Its type is kAdamMax. beta1 and beta2 is floats, 0 < beta < 1, generally close to 1.

+ +
+
updater {
+  type: kAdamMax
+  adammax_conf {
+   beta1: float # [0,1]
+   beta2: float # [0,1]
+  }
+}
 

Configuration of learning rate

Modified: websites/staging/singa/trunk/content/docs/zh/checkpoint.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/checkpoint.html (original) +++ websites/staging/singa/trunk/content/docs/zh/checkpoint.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – CheckPoint Modified: websites/staging/singa/trunk/content/docs/zh/cnn.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/cnn.html (original) +++ websites/staging/singa/trunk/content/docs/zh/cnn.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – CNN Example Modified: websites/staging/singa/trunk/content/docs/zh/data.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/data.html (original) +++ websites/staging/singa/trunk/content/docs/zh/data.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Data Preparation Modified: websites/staging/singa/trunk/content/docs/zh/distributed-training.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/distributed-training.html (original) +++ websites/staging/singa/trunk/content/docs/zh/distributed-training.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Distributed Training Modified: websites/staging/singa/trunk/content/docs/zh/index.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/index.html (original) +++ websites/staging/singa/trunk/content/docs/zh/index.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Modified: websites/staging/singa/trunk/content/docs/zh/installation_source.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/installation_source.html (original) +++ websites/staging/singa/trunk/content/docs/zh/installation_source.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 从源程序安装SIGNA Modified: websites/staging/singa/trunk/content/docs/zh/mlp.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/mlp.html (original) +++ websites/staging/singa/trunk/content/docs/zh/mlp.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – MLP Example Modified: websites/staging/singa/trunk/content/docs/zh/neural-net.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/neural-net.html (original) +++ websites/staging/singa/trunk/content/docs/zh/neural-net.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Neural Net Modified: websites/staging/singa/trunk/content/docs/zh/overview.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/overview.html (original) +++ websites/staging/singa/trunk/content/docs/zh/overview.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 简介 Modified: websites/staging/singa/trunk/content/docs/zh/programming-guide.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/programming-guide.html (original) +++ websites/staging/singa/trunk/content/docs/zh/programming-guide.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – 编程指南 Modified: websites/staging/singa/trunk/content/docs/zh/rnn.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/rnn.html (original) +++ websites/staging/singa/trunk/content/docs/zh/rnn.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Recurrent Neural Networks for Language Modelling Modified: websites/staging/singa/trunk/content/docs/zh/train-one-batch.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/train-one-batch.html (original) +++ websites/staging/singa/trunk/content/docs/zh/train-one-batch.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Train-One-Batch Modified: websites/staging/singa/trunk/content/docs/zh/updater.html ============================================================================== --- websites/staging/singa/trunk/content/docs/zh/updater.html (original) +++ websites/staging/singa/trunk/content/docs/zh/updater.html Wed Apr 20 05:12:03 2016 @@ -1,13 +1,13 @@ - + Apache SINGA – Updater