You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by bu...@apache.org on 2016/01/13 04:47:58 UTC

svn commit: r977575 [8/19] - in /websites/staging/singa/trunk/content: ./ community/ develop/ docs/ docs/jp/ docs/kr/ docs/zh/ releases/ v0.1.0/

Added: websites/staging/singa/trunk/content/docs/jp/param.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/jp/param.html (added)
+++ websites/staging/singa/trunk/content/docs/jp/param.html Wed Jan 13 03:47:56 2016
@@ -0,0 +1,523 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2016-01-13 
+ | Rendered using Apache Maven Fluido Skin 1.4
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20160113" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache SINGA &#x2013; Parameters</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+
+      
+    
+    
+  
+    <script type="text/javascript" src="../../js/apache-maven-fluido-1.4.min.js"></script>
+
+                          
+        
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
+                      
+        
+<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
+                      
+        
+<meta content="Apache SINGA" name="author"/>
+                      
+        
+<meta content="SINGA, Deep Learning, Distributed training" name="keywords"/>
+          
+                  </head>
+        <body class="topBarEnabled">
+          
+    
+    
+            
+    
+        
+    <a href="https://github.com/apache/incubator-singa">
+      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
+        src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"
+        alt="Fork me on GitHub">
+    </a>
+  
+                
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top navbar-inverse">
+      <div class="navbar-inner">
+                <div class="container-fluid">
+        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </a>
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache SINGA <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../docs/overview.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="../../docs/quick-start.html"  title="Quick Start">Quick Start</a>
+</li>
+                  
+                      <li>      <a href="../../downloads.html"  title="Downloads">Downloads</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentaion <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li class="dropdown-submenu">
+                                      <a href="../../docs/index.html"  title="Latest">Latest</a>
+              <ul class="dropdown-menu">
+                                  <li>      <a href="../../docs/installation.html"  title="Installation">Installation</a>
+</li>
+                                  <li>      <a href="../../docs/programmer-guide.html"  title="Programmer Guide">Programmer Guide</a>
+</li>
+                                  <li>      <a href="../../docs/distributed-training.html"  title="Distributed Training">Distributed Training</a>
+</li>
+                                  <li>      <a href="../../docs/data.html"  title="Data Preparation">Data Preparation</a>
+</li>
+                                  <li>      <a href="../../docs/checkpoint.html"  title="Checkpoint">Checkpoint</a>
+</li>
+                                  <li>      <a href="../../docs/test.html"  title="Test">Test</a>
+</li>
+                                  <li>      <a href="../../docs/examples.html"  title="Examples">Examples</a>
+</li>
+                                  <li>      <a href="../../docs/debug.html"  title="Debug">Debug</a>
+</li>
+                              </ul>
+            </li>
+                  
+                      <li>      <a href="../../v0.1.0/index.html"  title="v0.1.0">v0.1.0</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../develop/schedule.html"  title="Schedule">Schedule</a>
+</li>
+                  
+                      <li class="dropdown-submenu">
+                                      <a href="../../develop/how-contribute.html"  title="How to Contribute">How to Contribute</a>
+              <ul class="dropdown-menu">
+                                  <li>      <a href="../../develop/contribute-code.html"  title="Code">Code</a>
+</li>
+                                  <li>      <a href="../../develop/contribute-docs.html"  title="Documentation">Documentation</a>
+</li>
+                              </ul>
+            </li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../community/source-repository.html"  title="Source Repository">Source Repository</a>
+</li>
+                  
+                      <li>      <a href="../../community/mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="../../community/issue-tracking.html"  title="Issue Tracking">Issue Tracking</a>
+</li>
+                  
+                      <li>      <a href="../../community/team-list.html"  title="SINGA Team">SINGA Team</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">External Links <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://www.apache.org/"  title="Apache Software Foundation">Apache Software Foundation</a>
+</li>
+                  
+                      <li>      <a href="http://www.comp.nus.edu.sg/~dbsystem/singa/"  title="NUS Site">NUS Site</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+          
+          
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="../../index.html" id="bannerLeft" title="Apache SINGA">
+                                                                                                <img src="../../images/singa-logo.png"  alt="Apache SINGA"/>
+                </a>
+                      </div>
+        <div class="pull-right">              <div id="bannerRight">
+                                                                                                <img src="../../images/singa-title.png"  alt="Apache SINGA"/>
+                </div>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                              <li class="">
+                    <a href="../../index.html" title="Apache SINGA">
+        Apache SINGA</a>
+                    <span class="divider">/</span>
+      </li>
+        <li class="active ">Parameters</li>
+        
+                
+                    
+      
+                            </ul>
+      </div>
+
+                  
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Apache SINGA</li>
+                              
+      <li>
+  
+                          <a href="../../docs/overview.html" title="Introduction">
+          <span class="none"></span>
+        Introduction</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../docs/quick-start.html" title="Quick Start">
+          <span class="none"></span>
+        Quick Start</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../downloads.html" title="Downloads">
+          <span class="none"></span>
+        Downloads</a>
+            </li>
+                              <li class="nav-header">Documentaion</li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+      <li>
+  
+                          <a href="../../docs/index.html" title="Latest">
+          <span class="icon-chevron-right"></span>
+        Latest</a>
+                  </li>
+                
+      <li>
+  
+                          <a href="../../v0.1.0/index.html" title="v0.1.0">
+          <span class="none"></span>
+        v0.1.0</a>
+            </li>
+                              <li class="nav-header">Development</li>
+                              
+      <li>
+  
+                          <a href="../../develop/schedule.html" title="Schedule">
+          <span class="none"></span>
+        Schedule</a>
+            </li>
+                                                                                    
+      <li>
+  
+                          <a href="../../develop/how-contribute.html" title="How to Contribute">
+          <span class="icon-chevron-right"></span>
+        How to Contribute</a>
+                  </li>
+                              <li class="nav-header">Community</li>
+                              
+      <li>
+  
+                          <a href="../../community/source-repository.html" title="Source Repository">
+          <span class="none"></span>
+        Source Repository</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/mail-lists.html" title="Mailing Lists">
+          <span class="none"></span>
+        Mailing Lists</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/issue-tracking.html" title="Issue Tracking">
+          <span class="none"></span>
+        Issue Tracking</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/team-list.html" title="SINGA Team">
+          <span class="none"></span>
+        SINGA Team</a>
+            </li>
+                              <li class="nav-header">External Links</li>
+                              
+      <li>
+  
+                          <a href="http://www.apache.org/" class="externalLink" title="Apache Software Foundation">
+          <span class="none"></span>
+        Apache Software Foundation</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.comp.nus.edu.sg/~dbsystem/singa/" class="externalLink" title="NUS Site">
+          <span class="none"></span>
+        NUS Site</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                                                                                                                   <a href="http://incubator.apache.org" title="apache-incubator" class="builtBy">
+        <img class="builtBy"  alt="Apache Incubator" src="http://incubator.apache.org/images/egg-logo.png"    />
+      </a>
+                      </div>
+          </div>
+        </div>
+        
+                        
+        <div id="bodyColumn"  class="span10" >
+                                  
+            <h1>Parameters</h1>
+<hr />
+<p>A <tt>Param</tt> object in SINGA represents a set of parameters, e.g., a weight matrix or a bias vector. <i>Basic user guide</i> describes how to configure for a <tt>Param</tt> object, and <i>Advanced user guide</i> provides details on implementing users&#x2019; parameter initialization methods.</p>
+<div class="section">
+<h2><a name="Basic_user_guide"></a>Basic user guide</h2>
+<p>The configuration of a Param object is inside a layer configuration, as the <tt>Param</tt> are associated with layers. An example configuration is like</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">layer {
+  ...
+  param {
+    name : &quot;p1&quot;
+    init {
+      type : kConstant
+      value: 1
+    }
+  }
+}
+</pre></div></div>
+<p>The <a href="overview.html">SGD algorithm</a> starts with initializing all parameters according to user specified initialization method (the <tt>init</tt> field). For the above example, all parameters in <tt>Param</tt> &#x201c;p1&#x201d; will be initialized to constant value 1. The configuration fields of a Param object is defined in <a href="../api/classsinga_1_1ParamProto.html">ParamProto</a>:</p>
+
+<ul>
+  
+<li>name, an identifier string. It is an optional field. If not provided, SINGA  will generate one based on layer name and its order in the layer.</li>
+  
+<li>init, field for setting initialization methods.</li>
+  
+<li>share_from, name of another <tt>Param</tt> object, from which this <tt>Param</tt> will share  configurations and values.</li>
+  
+<li>lr_scale, float value to be multiplied with the learning rate when  <a href="updater.html">updating the parameters</a></li>
+  
+<li>wd_scale, float value to be multiplied with the weight decay when  <a href="updater.html">updating the parameters</a></li>
+</ul>
+<p>There are some other fields that are specific to initialization methods.</p>
+<div class="section">
+<h3><a name="Initialization_methods"></a>Initialization methods</h3>
+<p>Users can set the <tt>type</tt> of <tt>init</tt> use the following built-in initialization methods,</p>
+
+<ul>
+  
+<li>
+<p><tt>kConst</tt>, set all parameters of the Param object to a constant value</p>
+  
+<div class="source">
+<div class="source"><pre class="prettyprint">type: kConst
+value: float  # default is 1
+</pre></div></div></li>
+  
+<li>
+<p><tt>kGaussian</tt>, initialize the parameters following a Gaussian distribution.</p>
+  
+<div class="source">
+<div class="source"><pre class="prettyprint">type: kGaussian
+mean: float # mean of the Gaussian distribution, default is 0
+std: float # standard variance, default is 1
+value: float # default 0
+</pre></div></div></li>
+  
+<li>
+<p><tt>kUniform</tt>, initialize the parameters following an uniform distribution</p>
+  
+<div class="source">
+<div class="source"><pre class="prettyprint">type: kUniform
+low: float # lower boundary, default is -1
+high: float # upper boundary, default is 1
+value: float # default 0
+</pre></div></div></li>
+  
+<li>
+<p><tt>kGaussianSqrtFanIn</tt>, initialize <tt>Param</tt> objects with two dimensions (i.e.,  matrix) using <tt>kGaussian</tt> and then  multiple each parameter with <tt>1/sqrt(fan_in)</tt>, where<tt>fan_in</tt> is the number of  columns of the matrix.</p></li>
+  
+<li>
+<p><tt>kUniformSqrtFanIn</tt>, the same as <tt>kGaussianSqrtFanIn</tt> except that the  distribution is an uniform distribution.</p></li>
+  
+<li>
+<p><tt>kUniformFanInOut</tt>, initialize matrix <tt>Param</tt> objects using <tt>kUniform</tt> and then  multiple each parameter with <tt>sqrt(6/(fan_in + fan_out))</tt>, where<tt>fan_in +
+  fan_out</tt> sums up the number of columns and rows of the matrix.</p></li>
+</ul>
+<p>For all above initialization methods except <tt>kConst</tt>, if their <tt>value</tt> is not 1, every parameter will be multiplied with <tt>value</tt>. Users can also implement their own initialization method following the <i>Advanced user guide</i>.</p></div></div>
+<div class="section">
+<h2><a name="Advanced_user_guide"></a>Advanced user guide</h2>
+<p>This sections describes the details on implementing new parameter initialization methods.</p>
+<div class="section">
+<h3><a name="Base_ParamGenerator"></a>Base ParamGenerator</h3>
+<p>All initialization methods are implemented as subclasses of the base <tt>ParamGenerator</tt> class.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">class ParamGenerator {
+ public:
+  virtual void Init(const ParamGenProto&amp;);
+  void Fill(Param*);
+
+ protected:
+  ParamGenProto proto_;
+};
+</pre></div></div>
+<p>Configurations of the initialization method is in <tt>ParamGenProto</tt>. The <tt>Fill</tt> function fills the <tt>Param</tt> object (passed in as an argument).</p></div>
+<div class="section">
+<h3><a name="New_ParamGenerator_subclass"></a>New ParamGenerator subclass</h3>
+<p>Similar to implement a new Layer subclass, users can define a configuration protocol message,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint"># in user.proto
+message FooParamProto {
+  optional int32 x = 1;
+}
+extend ParamGenProto {
+  optional FooParamProto fooparam_conf =101;
+}
+</pre></div></div>
+<p>The configuration of <tt>Param</tt> would be</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">param {
+  ...
+  init {
+    user_type: 'FooParam&quot; # must use user_type for user defined methods
+    [fooparam_conf] { # must use brackets for configuring user defined messages
+      x: 10
+    }
+  }
+}
+</pre></div></div>
+<p>The subclass could be declared as,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">class FooParamGen : public ParamGenerator {
+ public:
+  void Fill(Param*) override;
+};
+</pre></div></div>
+<p>Users can access the configuration fields in <tt>Fill</tt> by</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">int x = proto_.GetExtension(fooparam_conf).x();
+</pre></div></div>
+<p>To use the new initialization method, users need to register it in the <a href="programming-guide.html">main function</a>.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">driver.RegisterParamGenerator&lt;FooParamGen&gt;(&quot;FooParam&quot;)  # must be consistent with the user_type in configuration
+</pre></div></div>
+<p>{% comment %}</p></div>
+<div class="section">
+<h3><a name="Base_Param_class"></a>Base Param class</h3></div>
+<div class="section">
+<h3><a name="Members"></a>Members</h3>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">int local_version_;
+int slice_start_;
+vector&lt;int&gt; slice_offset_, slice_size_;
+
+shared_ptr&lt;Blob&lt;float&gt;&gt; data_;
+Blob&lt;float&gt; grad_;
+ParamProto proto_;
+</pre></div></div>
+<p>Each Param object has a local version and a global version (inside the data Blob). These two versions are used for synchronization. If multiple Param objects share the same values, they would have the same <tt>data_</tt> field. Consequently, their global version is the same. The global version is updated by <a href="communication.html">the stub thread</a>. The local version is updated in <tt>Worker::Update</tt> function which assigns the global version to the local version. The <tt>Worker::Collect</tt> function is blocked until the global version is larger than the local version, i.e., when <tt>data_</tt> is updated. In this way, we synchronize workers sharing parameters.</p>
+<p>In Deep learning models, some Param objects are 100 times larger than others. To ensure the load-balance among servers, SINGA slices large Param objects. The slicing information is recorded by <tt>slice_*</tt>. Each slice is assigned a unique ID starting from 0. <tt>slice_start_</tt> is the ID of the first slice of this Param object. <tt>slice_offset_[i]</tt> is the offset of the i-th slice in this Param object. <tt>slice_size_[i]</tt> is the size of the i-th slice. These slice information is used to create messages for transferring parameter values or gradients to different servers.</p>
+<p>Each Param object has a <tt>grad_</tt> field for gradients. Param objects do not share this Blob although they may share <tt>data_</tt>. Because each layer containing a Param object would contribute gradients. E.g., in RNN, the recurrent layers share parameters values, and the gradients used for updating are averaged from all recurrent these recurrent layers. In SINGA, the stub thread will aggregate local gradients for the same Param object. The server will do a global aggregation of gradients for the same Param object.</p>
+<p>The <tt>proto_</tt> field has some meta information, e.g., name and ID. It also has a field called <tt>owner</tt> which is the ID of the Param object that shares parameter values with others.</p></div>
+<div class="section">
+<h3><a name="Functions"></a>Functions</h3>
+<p>The base Param class implements two sets of functions,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">virtual void InitValues(int version = 0);  // initialize values according to `init_method`
+void ShareFrom(const Param&amp; other);  // share `data_` from `other` Param
+--------------
+virtual Msg* GenGetMsg(bool copy, int slice_idx);
+virtual Msg* GenPutMsg(bool copy, int slice_idx);
+... // other message related functions.
+</pre></div></div>
+<p>Besides the functions for processing the parameter values, there is a set of functions for generating and parsing messages. These messages are for transferring parameter values or gradients between workers and servers. Each message corresponds to one Param slice. If <tt>copy</tt> is false, it means the receiver of this message is in the same process as the sender. In such case, only pointers to the memory of parameter value (or gradient) are wrapped in the message; otherwise, the parameter values (or gradients) should be copied into the message.</p></div></div>
+<div class="section">
+<h2><a name="Implementing_Param_subclass"></a>Implementing Param subclass</h2>
+<p>Users can extend the base Param class to implement their own parameter initialization methods and message transferring protocols. Similar to implementing a new Layer subclasses, users can create google protocol buffer messages for configuring the Param subclass. The subclass, denoted as FooParam should be registered in main.cc,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">dirver.RegisterParam&lt;FooParam&gt;(kFooParam);  // kFooParam should be different to 0, which is for the base Param type
+</pre></div></div>
+
+<ul>
+  
+<li>type, an integer representing the <tt>Param</tt> type. Currently SINGA provides one <tt>Param</tt> implementation with type 0 (the default type). If users want to use their own Param implementation, they should extend the base Param class and configure this field with <tt>kUserParam</tt></li>
+</ul>
+<p>{% endcomment %}</p></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+                      <div class="row-fluid">
+                                                                          
+<p>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.</p>
+                          </div>
+
+        
+                </div>
+    </footer>
+        </body>
+</html>

Added: websites/staging/singa/trunk/content/docs/jp/programmer-guide.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/jp/programmer-guide.html (added)
+++ websites/staging/singa/trunk/content/docs/jp/programmer-guide.html Wed Jan 13 03:47:56 2016
@@ -0,0 +1,416 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2016-01-13 
+ | Rendered using Apache Maven Fluido Skin 1.4
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20160113" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache SINGA &#x2013; Programmer Guide</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+
+      
+    
+    
+  
+    <script type="text/javascript" src="../../js/apache-maven-fluido-1.4.min.js"></script>
+
+                          
+        
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
+                      
+        
+<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
+                      
+        
+<meta content="Apache SINGA" name="author"/>
+                      
+        
+<meta content="SINGA, Deep Learning, Distributed training" name="keywords"/>
+          
+                  </head>
+        <body class="topBarEnabled">
+          
+    
+    
+            
+    
+        
+    <a href="https://github.com/apache/incubator-singa">
+      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
+        src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"
+        alt="Fork me on GitHub">
+    </a>
+  
+                
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top navbar-inverse">
+      <div class="navbar-inner">
+                <div class="container-fluid">
+        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </a>
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache SINGA <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../docs/overview.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="../../docs/quick-start.html"  title="Quick Start">Quick Start</a>
+</li>
+                  
+                      <li>      <a href="../../downloads.html"  title="Downloads">Downloads</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentaion <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li class="dropdown-submenu">
+                                      <a href="../../docs/index.html"  title="Latest">Latest</a>
+              <ul class="dropdown-menu">
+                                  <li>      <a href="../../docs/installation.html"  title="Installation">Installation</a>
+</li>
+                                  <li>      <a href="../../docs/programmer-guide.html"  title="Programmer Guide">Programmer Guide</a>
+</li>
+                                  <li>      <a href="../../docs/distributed-training.html"  title="Distributed Training">Distributed Training</a>
+</li>
+                                  <li>      <a href="../../docs/data.html"  title="Data Preparation">Data Preparation</a>
+</li>
+                                  <li>      <a href="../../docs/checkpoint.html"  title="Checkpoint">Checkpoint</a>
+</li>
+                                  <li>      <a href="../../docs/test.html"  title="Test">Test</a>
+</li>
+                                  <li>      <a href="../../docs/examples.html"  title="Examples">Examples</a>
+</li>
+                                  <li>      <a href="../../docs/debug.html"  title="Debug">Debug</a>
+</li>
+                              </ul>
+            </li>
+                  
+                      <li>      <a href="../../v0.1.0/index.html"  title="v0.1.0">v0.1.0</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../develop/schedule.html"  title="Schedule">Schedule</a>
+</li>
+                  
+                      <li class="dropdown-submenu">
+                                      <a href="../../develop/how-contribute.html"  title="How to Contribute">How to Contribute</a>
+              <ul class="dropdown-menu">
+                                  <li>      <a href="../../develop/contribute-code.html"  title="Code">Code</a>
+</li>
+                                  <li>      <a href="../../develop/contribute-docs.html"  title="Documentation">Documentation</a>
+</li>
+                              </ul>
+            </li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../community/source-repository.html"  title="Source Repository">Source Repository</a>
+</li>
+                  
+                      <li>      <a href="../../community/mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="../../community/issue-tracking.html"  title="Issue Tracking">Issue Tracking</a>
+</li>
+                  
+                      <li>      <a href="../../community/team-list.html"  title="SINGA Team">SINGA Team</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">External Links <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://www.apache.org/"  title="Apache Software Foundation">Apache Software Foundation</a>
+</li>
+                  
+                      <li>      <a href="http://www.comp.nus.edu.sg/~dbsystem/singa/"  title="NUS Site">NUS Site</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+          
+          
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="../../index.html" id="bannerLeft" title="Apache SINGA">
+                                                                                                <img src="../../images/singa-logo.png"  alt="Apache SINGA"/>
+                </a>
+                      </div>
+        <div class="pull-right">              <div id="bannerRight">
+                                                                                                <img src="../../images/singa-title.png"  alt="Apache SINGA"/>
+                </div>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                              <li class="">
+                    <a href="../../index.html" title="Apache SINGA">
+        Apache SINGA</a>
+                    <span class="divider">/</span>
+      </li>
+        <li class="active ">Programmer Guide</li>
+        
+                
+                    
+      
+                            </ul>
+      </div>
+
+                  
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Apache SINGA</li>
+                              
+      <li>
+  
+                          <a href="../../docs/overview.html" title="Introduction">
+          <span class="none"></span>
+        Introduction</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../docs/quick-start.html" title="Quick Start">
+          <span class="none"></span>
+        Quick Start</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../downloads.html" title="Downloads">
+          <span class="none"></span>
+        Downloads</a>
+            </li>
+                              <li class="nav-header">Documentaion</li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+      <li>
+  
+                          <a href="../../docs/index.html" title="Latest">
+          <span class="icon-chevron-right"></span>
+        Latest</a>
+                  </li>
+                
+      <li>
+  
+                          <a href="../../v0.1.0/index.html" title="v0.1.0">
+          <span class="none"></span>
+        v0.1.0</a>
+            </li>
+                              <li class="nav-header">Development</li>
+                              
+      <li>
+  
+                          <a href="../../develop/schedule.html" title="Schedule">
+          <span class="none"></span>
+        Schedule</a>
+            </li>
+                                                                                    
+      <li>
+  
+                          <a href="../../develop/how-contribute.html" title="How to Contribute">
+          <span class="icon-chevron-right"></span>
+        How to Contribute</a>
+                  </li>
+                              <li class="nav-header">Community</li>
+                              
+      <li>
+  
+                          <a href="../../community/source-repository.html" title="Source Repository">
+          <span class="none"></span>
+        Source Repository</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/mail-lists.html" title="Mailing Lists">
+          <span class="none"></span>
+        Mailing Lists</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/issue-tracking.html" title="Issue Tracking">
+          <span class="none"></span>
+        Issue Tracking</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/team-list.html" title="SINGA Team">
+          <span class="none"></span>
+        SINGA Team</a>
+            </li>
+                              <li class="nav-header">External Links</li>
+                              
+      <li>
+  
+                          <a href="http://www.apache.org/" class="externalLink" title="Apache Software Foundation">
+          <span class="none"></span>
+        Apache Software Foundation</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.comp.nus.edu.sg/~dbsystem/singa/" class="externalLink" title="NUS Site">
+          <span class="none"></span>
+        NUS Site</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                                                                                                                   <a href="http://incubator.apache.org" title="apache-incubator" class="builtBy">
+        <img class="builtBy"  alt="Apache Incubator" src="http://incubator.apache.org/images/egg-logo.png"    />
+      </a>
+                      </div>
+          </div>
+        </div>
+        
+                        
+        <div id="bodyColumn"  class="span10" >
+                                  
+            <h1>Programmer Guide</h1>
+<hr />
+<p>To submit a training job, users must provide the configuration of the four components shown in Figure 1:</p>
+
+<ul>
+  
+<li>a <a href="neural-net.html">NeuralNet</a> describing the neural net structure with the detailed layer setting and their connections;</li>
+  
+<li>a <a href="train-one-batch.html">TrainOneBatch</a> algorithm which is tailored for different model categories;</li>
+  
+<li>an <a href="updater.html">Updater</a> defining the protocol for updating parameters at the server side;</li>
+  
+<li>a <a href="distributed-training.html">Cluster Topology</a> specifying the distributed architecture of workers and servers.</li>
+</ul>
+<p>The <i>Basic user guide</i> section describes how to submit a training job using built-in components; while the <i>Advanced user guide</i> section presents details on writing user&#x2019;s own main function to register components implemented by themselves. In addition, the training data must be prepared, which has the same <a href="data.html">process</a> for both advanced users and basic users.</p>
+<p><img src="../images/overview.png" align="center" width="400px" alt="" /> <span><b>Figure 1 - SINGA overview.</b></span></p>
+<div class="section">
+<h2><a name="Basic_user_guide"></a>Basic user guide</h2>
+<p>Users can use the default main function provided by SINGA to submit the training job. For this case, a job configuration file written as a google protocol buffer message for the <a href="../api/classsinga_1_1JobProto.html">JobProto</a> must be provided in the command line,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">./bin/singa-run.sh -conf &lt;path to job conf&gt; [-resume] [-test]
+</pre></div></div>
+
+<ul>
+  
+<li><tt>-resume</tt> is for continuing the training from last <a href="checkpoint.html">checkpoint</a>.</li>
+  
+<li><tt>-test</tt> is for testing the performance of previously trained model and extracting features for new data, more details are available <a href="test.html">here</a>.</li>
+</ul>
+<p>The <a href="mlp.html">MLP</a> and <a href="cnn.html">CNN</a> examples use built-in components. Please read the corresponding pages for their job configuration files. The subsequent pages will illustrate the details on each component of the configuration.</p></div>
+<div class="section">
+<h2><a name="Advanced_user_guide"></a>Advanced user guide</h2>
+<p>If a user&#x2019;s model contains some user-defined components, e.g., <a href="updater.html">Updater</a>, he has to write a main function to register these components. It is similar to Hadoop&#x2019;s main function. Generally, the main function should</p>
+
+<ul>
+  
+<li>
+<p>initialize SINGA, e.g., setup logging.</p></li>
+  
+<li>
+<p>register user-defined components.</p></li>
+  
+<li>
+<p>create and pass the job configuration to SINGA driver</p></li>
+</ul>
+<p>An example main function is like</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">#include &lt;string&gt;
+#include &quot;singa.h&quot;
+#include &quot;user.h&quot;  // header for user code
+
+int main(int argc, char** argv) {
+  singa::Driver driver;
+  driver.Init(argc, argv);
+  bool resume;
+  // parse resume option from argv.
+
+  // register user defined layers
+  driver.RegisterLayer&lt;FooLayer, std::string&gt;(&quot;kFooLayer&quot;);
+  // register user defined updater
+  driver.RegisterUpdater&lt;FooUpdater, std::string&gt;(&quot;kFooUpdater&quot;);
+  ...
+  auto jobConf = driver.job_conf();
+  //  update jobConf
+
+  driver.Submit(resume, jobConf);
+  return 0;
+}
+</pre></div></div>
+<p>The Driver class&#x2019; <tt>Init</tt> method will load a job configuration file provided by users as a command line argument (<tt>-conf &lt;job conf&gt;</tt>). It contains at least the cluster topology and returns the <tt>jobConf</tt> for users to update or fill in configurations of neural net, updater, etc. If users define subclasses of Layer, Updater, Worker and Param, they should register them through the driver. Finally, the job configuration is submitted to the driver which starts the training.</p>
+<p>We will provide helper functions to make the configuration easier in the future, like <a class="externalLink" href="https://github.com/fchollet/keras">keras</a>.</p>
+<p>Users need to compile and link their code (e.g., layer implementations and the main file) with SINGA library (<i>.libs/libsinga.so</i>) to generate an executable file, e.g., with name <i>mysinga</i>. To launch the program, users just pass the path of the <i>mysinga</i> and base job configuration to <i>./bin/singa-run.sh</i>.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">./bin/singa-run.sh -conf &lt;path to job conf&gt; -exec &lt;path to mysinga&gt; [other arguments]
+</pre></div></div>
+<p>The <a href="rnn.html">RNN application</a> provides a full example of implementing the main function for training a specific RNN model.</p></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+                      <div class="row-fluid">
+                                                                          
+<p>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.</p>
+                          </div>
+
+        
+                </div>
+    </footer>
+        </body>
+</html>

Added: websites/staging/singa/trunk/content/docs/jp/programming-guide.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/jp/programming-guide.html (added)
+++ websites/staging/singa/trunk/content/docs/jp/programming-guide.html Wed Jan 13 03:47:56 2016
@@ -0,0 +1,408 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2016-01-13 
+ | Rendered using Apache Maven Fluido Skin 1.4
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <meta name="Date-Revision-yyyymmdd" content="20160113" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache SINGA &#x2013; Programming Guide</title>
+    <link rel="stylesheet" href="../../css/apache-maven-fluido-1.4.min.css" />
+    <link rel="stylesheet" href="../../css/site.css" />
+    <link rel="stylesheet" href="../../css/print.css" media="print" />
+
+      
+    
+    
+  
+    <script type="text/javascript" src="../../js/apache-maven-fluido-1.4.min.js"></script>
+
+                          
+        
+<script src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript"></script>
+                      
+        
+<script type="text/x-mathjax-config">MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});</script>
+                      
+        
+<meta content="Apache SINGA" name="author"/>
+                      
+        
+<meta content="SINGA, Deep Learning, Distributed training" name="keywords"/>
+          
+                  </head>
+        <body class="topBarEnabled">
+          
+    
+    
+            
+    
+        
+    <a href="https://github.com/apache/incubator-singa">
+      <img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10000;"
+        src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"
+        alt="Fork me on GitHub">
+    </a>
+  
+                
+                    
+                
+
+    <div id="topbar" class="navbar navbar-fixed-top navbar-inverse">
+      <div class="navbar-inner">
+                <div class="container-fluid">
+        <a data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar">
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+          <span class="icon-bar"></span>
+        </a>
+                
+                                <ul class="nav">
+                          <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache SINGA <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../docs/overview.html"  title="Introduction">Introduction</a>
+</li>
+                  
+                      <li>      <a href="../../docs/quick-start.html"  title="Quick Start">Quick Start</a>
+</li>
+                  
+                      <li>      <a href="../../downloads.html"  title="Downloads">Downloads</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentaion <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li class="dropdown-submenu">
+                                      <a href="../../docs/index.html"  title="Latest">Latest</a>
+              <ul class="dropdown-menu">
+                                  <li>      <a href="../../docs/installation.html"  title="Installation">Installation</a>
+</li>
+                                  <li>      <a href="../../docs/programmer-guide.html"  title="Programmer Guide">Programmer Guide</a>
+</li>
+                                  <li>      <a href="../../docs/distributed-training.html"  title="Distributed Training">Distributed Training</a>
+</li>
+                                  <li>      <a href="../../docs/data.html"  title="Data Preparation">Data Preparation</a>
+</li>
+                                  <li>      <a href="../../docs/checkpoint.html"  title="Checkpoint">Checkpoint</a>
+</li>
+                                  <li>      <a href="../../docs/test.html"  title="Test">Test</a>
+</li>
+                                  <li>      <a href="../../docs/examples.html"  title="Examples">Examples</a>
+</li>
+                                  <li>      <a href="../../docs/debug.html"  title="Debug">Debug</a>
+</li>
+                              </ul>
+            </li>
+                  
+                      <li>      <a href="../../v0.1.0/index.html"  title="v0.1.0">v0.1.0</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../develop/schedule.html"  title="Schedule">Schedule</a>
+</li>
+                  
+                      <li class="dropdown-submenu">
+                                      <a href="../../develop/how-contribute.html"  title="How to Contribute">How to Contribute</a>
+              <ul class="dropdown-menu">
+                                  <li>      <a href="../../develop/contribute-code.html"  title="Code">Code</a>
+</li>
+                                  <li>      <a href="../../develop/contribute-docs.html"  title="Documentation">Documentation</a>
+</li>
+                              </ul>
+            </li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Community <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="../../community/source-repository.html"  title="Source Repository">Source Repository</a>
+</li>
+                  
+                      <li>      <a href="../../community/mail-lists.html"  title="Mailing Lists">Mailing Lists</a>
+</li>
+                  
+                      <li>      <a href="../../community/issue-tracking.html"  title="Issue Tracking">Issue Tracking</a>
+</li>
+                  
+                      <li>      <a href="../../community/team-list.html"  title="SINGA Team">SINGA Team</a>
+</li>
+                          </ul>
+      </li>
+                <li class="dropdown">
+        <a href="#" class="dropdown-toggle" data-toggle="dropdown">External Links <b class="caret"></b></a>
+        <ul class="dropdown-menu">
+        
+                      <li>      <a href="http://www.apache.org/"  title="Apache Software Foundation">Apache Software Foundation</a>
+</li>
+                  
+                      <li>      <a href="http://www.comp.nus.edu.sg/~dbsystem/singa/"  title="NUS Site">NUS Site</a>
+</li>
+                          </ul>
+      </li>
+                  </ul>
+          
+          
+          
+                   
+                      </div>
+          
+        </div>
+      </div>
+    </div>
+    
+        <div class="container-fluid">
+          <div id="banner">
+        <div class="pull-left">
+                                                  <a href="../../index.html" id="bannerLeft" title="Apache SINGA">
+                                                                                                <img src="../../images/singa-logo.png"  alt="Apache SINGA"/>
+                </a>
+                      </div>
+        <div class="pull-right">              <div id="bannerRight">
+                                                                                                <img src="../../images/singa-title.png"  alt="Apache SINGA"/>
+                </div>
+      </div>
+        <div class="clear"><hr/></div>
+      </div>
+
+      <div id="breadcrumbs">
+        <ul class="breadcrumb">
+                
+                    
+                              <li class="">
+                    <a href="../../index.html" title="Apache SINGA">
+        Apache SINGA</a>
+                    <span class="divider">/</span>
+      </li>
+        <li class="active ">Programming Guide</li>
+        
+                
+                    
+      
+                            </ul>
+      </div>
+
+                  
+      <div class="row-fluid">
+        <div id="leftColumn" class="span2">
+          <div class="well sidebar-nav">
+                
+                    
+                <ul class="nav nav-list">
+                    <li class="nav-header">Apache SINGA</li>
+                              
+      <li>
+  
+                          <a href="../../docs/overview.html" title="Introduction">
+          <span class="none"></span>
+        Introduction</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../docs/quick-start.html" title="Quick Start">
+          <span class="none"></span>
+        Quick Start</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../downloads.html" title="Downloads">
+          <span class="none"></span>
+        Downloads</a>
+            </li>
+                              <li class="nav-header">Documentaion</li>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
+      <li>
+  
+                          <a href="../../docs/index.html" title="Latest">
+          <span class="icon-chevron-right"></span>
+        Latest</a>
+                  </li>
+                
+      <li>
+  
+                          <a href="../../v0.1.0/index.html" title="v0.1.0">
+          <span class="none"></span>
+        v0.1.0</a>
+            </li>
+                              <li class="nav-header">Development</li>
+                              
+      <li>
+  
+                          <a href="../../develop/schedule.html" title="Schedule">
+          <span class="none"></span>
+        Schedule</a>
+            </li>
+                                                                                    
+      <li>
+  
+                          <a href="../../develop/how-contribute.html" title="How to Contribute">
+          <span class="icon-chevron-right"></span>
+        How to Contribute</a>
+                  </li>
+                              <li class="nav-header">Community</li>
+                              
+      <li>
+  
+                          <a href="../../community/source-repository.html" title="Source Repository">
+          <span class="none"></span>
+        Source Repository</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/mail-lists.html" title="Mailing Lists">
+          <span class="none"></span>
+        Mailing Lists</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/issue-tracking.html" title="Issue Tracking">
+          <span class="none"></span>
+        Issue Tracking</a>
+            </li>
+                
+      <li>
+  
+                          <a href="../../community/team-list.html" title="SINGA Team">
+          <span class="none"></span>
+        SINGA Team</a>
+            </li>
+                              <li class="nav-header">External Links</li>
+                              
+      <li>
+  
+                          <a href="http://www.apache.org/" class="externalLink" title="Apache Software Foundation">
+          <span class="none"></span>
+        Apache Software Foundation</a>
+            </li>
+                
+      <li>
+  
+                          <a href="http://www.comp.nus.edu.sg/~dbsystem/singa/" class="externalLink" title="NUS Site">
+          <span class="none"></span>
+        NUS Site</a>
+            </li>
+            </ul>
+                
+                    
+                
+          <hr />
+
+           <div id="poweredBy">
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                            <div class="clear"></div>
+                                                                                                                   <a href="http://incubator.apache.org" title="apache-incubator" class="builtBy">
+        <img class="builtBy"  alt="Apache Incubator" src="http://incubator.apache.org/images/egg-logo.png"    />
+      </a>
+                      </div>
+          </div>
+        </div>
+        
+                        
+        <div id="bodyColumn"  class="span10" >
+                                  
+            <h1>Programming Guide</h1>
+<hr />
+<p>To submit a training job, users must provide the configuration of the four components shown in Figure 1:</p>
+
+<ul>
+  
+<li>a <a href="neural-net.html">NeuralNet</a> describing the neural net structure with the detailed layer setting and their connections;</li>
+  
+<li>a <a href="train-one-batch.html">TrainOneBatch</a> algorithm which is tailored for different model categories;</li>
+  
+<li>an <a href="updater.html">Updater</a> defining the protocol for updating parameters at the server side;</li>
+  
+<li>a <a href="distributed-training.html">Cluster Topology</a> specifying the distributed architecture of workers and servers.</li>
+</ul>
+<p>The <i>Basic user guide</i> section describes how to submit a training job using built-in components; while the <i>Advanced user guide</i> section presents details on writing user&#x2019;s own main function to register components implemented by themselves. In addition, the training data must be prepared, which has the same <a href="data.html">process</a> for both advanced users and basic users.</p>
+<p><img src="../images/overview.png" align="center" width="400px" alt="" /> <span><b>Figure 1 - SINGA overview.</b></span></p>
+<div class="section">
+<h2><a name="Basic_user_guide"></a>Basic user guide</h2>
+<p>Users can use the default main function provided SINGA to submit the training job. For this case, a job configuration file written as a google protocol buffer message for the <a href="../api/classsinga_1_1JobProto.html">JobProto</a> must be provided in the command line,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">./bin/singa-run.sh -conf &lt;path to job conf&gt; [-resume]
+</pre></div></div>
+<p><tt>-resume</tt> is for continuing the training from last <a href="checkpoint.html">checkpoint</a>. The <a href="mlp.html">MLP</a> and <a href="cnn.html">CNN</a> examples use built-in components. Please read the corresponding pages for their job configuration files. The subsequent pages will illustrate the details on each component of the configuration.</p></div>
+<div class="section">
+<h2><a name="Advanced_user_guide"></a>Advanced user guide</h2>
+<p>If a user&#x2019;s model contains some user-defined components, e.g., <a href="updater.html">Updater</a>, he has to write a main function to register these components. It is similar to Hadoop&#x2019;s main function. Generally, the main function should</p>
+
+<ul>
+  
+<li>
+<p>initialize SINGA, e.g., setup logging.</p></li>
+  
+<li>
+<p>register user-defined components.</p></li>
+  
+<li>
+<p>create and pass the job configuration to SINGA driver</p></li>
+</ul>
+<p>An example main function is like</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">#include &quot;singa.h&quot;
+#include &quot;user.h&quot;  // header for user code
+
+int main(int argc, char** argv) {
+  singa::Driver driver;
+  driver.Init(argc, argv);
+  bool resume;
+  // parse resume option from argv.
+
+  // register user defined layers
+  driver.RegisterLayer&lt;FooLayer&gt;(kFooLayer);
+  // register user defined updater
+  driver.RegisterUpdater&lt;FooUpdater&gt;(kFooUpdater);
+  ...
+  auto jobConf = driver.job_conf();
+  //  update jobConf
+
+  driver.Train(resume, jobConf);
+  return 0;
+}
+</pre></div></div>
+<p>The Driver class&#x2019; <tt>Init</tt> method will load a job configuration file provided by users as a command line argument (<tt>-conf &lt;job conf&gt;</tt>). It contains at least the cluster topology and returns the <tt>jobConf</tt> for users to update or fill in configurations of neural net, updater, etc. If users define subclasses of Layer, Updater, Worker and Param, they should register them through the driver. Finally, the job configuration is submitted to the driver which starts the training.</p>
+<p>We will provide helper functions to make the configuration easier in the future, like <a class="externalLink" href="https://github.com/fchollet/keras">keras</a>.</p>
+<p>Users need to compile and link their code (e.g., layer implementations and the main file) with SINGA library (<i>.libs/libsinga.so</i>) to generate an executable file, e.g., with name <i>mysinga</i>. To launch the program, users just pass the path of the <i>mysinga</i> and base job configuration to <i>./bin/singa-run.sh</i>.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">./bin/singa-run.sh -conf &lt;path to job conf&gt; -exec &lt;path to mysinga&gt; [other arguments]
+</pre></div></div>
+<p>The <a href="rnn.html">RNN application</a> provides a full example of implementing the main function for training a specific RNN model.</p></div>
+                  </div>
+            </div>
+          </div>
+
+    <hr/>
+
+    <footer>
+            <div class="container-fluid">
+                      <div class="row-fluid">
+                                                                          
+<p>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.</p>
+                          </div>
+
+        
+                </div>
+    </footer>
+        </body>
+</html>