singa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r977294 - in /websites/staging/singa/trunk/content: ./ docs/index.html docs/python.html downloads.html
Date Fri, 08 Jan 2016 09:42:34 GMT
Author: buildbot
Date: Fri Jan  8 09:42:34 2016
New Revision: 977294

Log:
Staging update by buildbot for singa

Added:
    websites/staging/singa/trunk/content/docs/python.html
Modified:
    websites/staging/singa/trunk/content/   (props changed)
    websites/staging/singa/trunk/content/docs/index.html
    websites/staging/singa/trunk/content/downloads.html

Propchange: websites/staging/singa/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jan  8 09:42:34 2016
@@ -1 +1 @@
-1723651
+1723668

Modified: websites/staging/singa/trunk/content/docs/index.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/index.html (original)
+++ websites/staging/singa/trunk/content/docs/index.html Fri Jan  8 09:42:34 2016
@@ -407,6 +407,8 @@
   
 <li><a href="checkpoint.html">Checkpoint and Resume</a></li>
   
+<li><a href="python.html">Python Binding</a></li>
+  
 <li><a href="test.html">Performance test and Feature extraction</a></li>
   
 <li><a href="gpu.html">Training on GPU</a></li>

Added: websites/staging/singa/trunk/content/docs/python.html
==============================================================================
--- websites/staging/singa/trunk/content/docs/python.html (added)
+++ websites/staging/singa/trunk/content/docs/python.html Fri Jan  8 09:42:34 2016
@@ -0,0 +1,755 @@
+<!DOCTYPE html>
+<!--
+ | Generated by Apache Maven Doxia at 2016-01-08 
+ | 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="20160108" />
+    <meta http-equiv="Content-Language" content="en" />
+    <title>Apache SINGA &#x2013; Python Binding</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 ">Python Binding</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>Python Binding</h1>
+<hr />
+<p>Python binding provides APIs for configuring a training job following <a class="externalLink"
href="http://keras.io/">keras</a>, including the configuration of neural net, training
algorithm, etc. It replaces the configuration file (e.g., <i>job.conf</i>) 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.</p>
+<p>Here is the layout of python related code,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">SINGAROOT/tool/python
+|-- pb2 (has job_pb2.py)
+|-- singa
+    |-- model.py
+    |-- layer.py
+    |-- parameter.py
+    |-- initialization.py
+    |-- utils
+        |-- utility.py
+        |-- message.py
+|-- examples
+    |-- cifar10_cnn.py, mnist_mlp.py, , mnist_rbm1.py, mnist_ae.py, etc.
+    |-- datasets
+        |-- cifar10.py
+        |-- mnist.py
+</pre></div></div>
+<div class="section">
+<h2><a name="Compiling_and_running_instructions"></a>Compiling and running
instructions</h2>
+<p>In order to use the Python APIs, users need to add the following option when compiling
SINGA,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">./configure --enable-python --with-python=PYTHON_DIR
+make
+</pre></div></div>
+<p>where PYTHON_DIR has Python.h</p>
+<p>The training program is launched by</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">bin/singa-run.sh -exec &lt;user_main.py&gt;
+</pre></div></div>
+<p>where user_main.py creates the JobProto object and pass it to Driver::Train to start
the training.</p>
+<p>For example,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">cd SINGA_ROOT
+bin/singa-run.sh -exec tool/python/examples/cifar10_cnn.py
+</pre></div></div></div>
+<div class="section">
+<h2><a name="Examples"></a>Examples</h2>
+<div class="section">
+<h3><a name="MLP_Example"></a>MLP Example</h3>
+<p>This example uses python APIs to configure and train a MLP model over the MNIST
dataset. The configuration content is the same as that written in <i>SINGAROOT/examples/mnist/job.conf</i>.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">X_train, X_test, workspace = mnist.load_data()
+
+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(10, init='uniform', activation='softmax'))
+
+sgd = SGD(lr=0.001, lr_type='step')
+topo = Cluster(workspace)
+m.compile(loss='categorical_crossentropy', optimizer=sgd, cluster=topo)
+m.fit(X_train, nb_epoch=1000, with_test=True)
+result = m.evaluate(X_test, batch_size=100, test_steps=10, test_freq=60)
+</pre></div></div></div>
+<div class="section">
+<h3><a name="CNN_Example"></a>CNN Example</h3>
+<p>This example uses python APIs to configure and train a CNN model over the Cifar10
dataset. The configuration content is the same as that written in <i>SINGAROOT/examples/cifar10/job.conf</i>.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">X_train, X_test, workspace = cifar10.load_data()
+
+m = Sequential('cnn', sys.argv)
+
+m.add(Convolution2D(32, 5, 1, 2, w_std=0.0001, b_lr=2))
+m.add(MaxPooling2D(pool_size=(3,3), stride=2))
+m.add(Activation('relu'))
+m.add(LRN2D(3, alpha=0.00005, beta=0.75))
+
+m.add(Convolution2D(32, 5, 1, 2, b_lr=2))
+m.add(Activation('relu'))
+m.add(AvgPooling2D(pool_size=(3,3), stride=2))
+m.add(LRN2D(3, alpha=0.00005, beta=0.75))
+
+m.add(Convolution2D(64, 5, 1, 2))
+m.add(Activation('relu'))
+m.add(AvgPooling2D(pool_size=(3,3), stride=2))
+
+m.add(Dense(10, w_wd=250, b_lr=2, b_wd=0, activation='softmax'))
+
+sgd = SGD(decay=0.004, lr_type='manual', step=(0,60000,65000), step_lr=(0.001,0.0001,0.00001))
+topo = Cluster(workspace)
+m.compile(updater=sgd, cluster=topo)
+m.fit(X_train, nb_epoch=1000, with_test=True)
+result = m.evaluate(X_test, 1000, test_steps=30, test_freq=300)
+</pre></div></div></div>
+<div class="section">
+<h3><a name="RBM_Example"></a>RBM Example</h3>
+<p>This example uses python APIs to configure and train a RBM model over the MNIST
dataset. The configuration content is the same as that written in <i>SINGAROOT/examples/rbm</i>.conf*.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">rbmid = 3
+X_train, X_test, workspace = mnist.load_data(nb_rbm=rbmid)
+m = Energy('rbm'+str(rbmid), sys.argv)
+
+out_dim = [1000, 500, 250]
+m.add(RBM(out_dim, w_std=0.1, b_wd=0))
+
+sgd = SGD(lr=0.1, decay=0.0002, momentum=0.8)
+topo = Cluster(workspace)
+m.compile(optimizer=sgd, cluster=topo)
+m.fit(X_train, alg='cd', nb_epoch=6000)
+</pre></div></div></div>
+<div class="section">
+<h3><a name="AutoEncoder_Example"></a>AutoEncoder Example</h3>
+<p>This example uses python APIs to configure and train an autoencoder model over the
MNIST dataset. The configuration content is the same as that written in <i>SINGAROOT/examples/autoencoder.conf</i>.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">rbmid = 4
+X_train, X_test, workspace = mnist.load_data(nb_rbm=rbmid+1)
+m = Sequential('autoencoder', sys.argv)
+
+hid_dim = [1000, 500, 250, 30]
+m.add(Autoencoder(hid_dim, out_dim=784, activation='sigmoid', param_share=True))
+
+agd = AdaGrad(lr=0.01)
+topo = Cluster(workspace)
+m.compile(loss='mean_squared_error', optimizer=agd, cluster=topo)
+m.fit(X_train, alg='bp', nb_epoch=12200)
+</pre></div></div></div>
+<div class="section">
+<h3><a name="To_run_SINGA_on_GPU"></a>To run SINGA on GPU</h3>
+<p>Users need to set a list of gpu ids to <tt>device</tt> field in fit()
or evaluate(). The number of GPUs must be the same to the number of workers configured for
cluster topology.</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">gpu_id = [0]
+m.fit(X_train, nb_epoch=100, with_test=True, device=gpu_id)
+</pre></div></div></div>
+<div class="section">
+<h3><a name="TIPS"></a>TIPS</h3>
+<p>Hidden layers for MLP can be configured as</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">for n in [2500, 2000, 1500, 1000,
500]:
+  m.add(Dense(n, init='uniform', activation='tanh'))
+m.add(Dense(10, init='uniform', activation='softmax'))
+</pre></div></div>
+<p>Activation layer can be specified separately</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">m.add(Dense(2500, init='uniform'))
+m.add(Activation('tanh'))
+</pre></div></div>
+<p>Users can explicitly specify hyper-parameters of weight and bias</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">par = Parameter(init='uniform',
scale=0.05)
+m.add(Dense(2500, w_param=par, b_param=par, activation='tanh'))
+m.add(Dense(2000, w_param=par, b_param=par, activation='tanh'))
+m.add(Dense(1500, w_param=par, b_param=par, activation='tanh'))
+m.add(Dense(1000, w_param=par, b_param=par, activation='tanh'))
+m.add(Dense(500, w_param=par, b_param=par, activation='tanh'))
+m.add(Dense(10, w_param=par, b_param=par, activation='softmax'))
+</pre></div></div>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">parw = Parameter(init='gauss', std=0.0001)
+parb = Parameter(init='const', value=0)
+m.add(Convolution(32, 5, 1, 2, w_param=parw, b_param=parb, b_lr=2))
+m.add(MaxPooling2D(pool_size(3,3), stride=2))
+m.add(Activation('relu'))
+m.add(LRN2D(3, alpha=0.00005, beta=0.75))
+
+parw.update(std=0.01)
+m.add(Convolution(32, 5, 1, 2, w_param=parw, b_param=parb))
+m.add(Activation('relu'))
+m.add(AvgPooling2D(pool_size(3,3), stride=2))
+m.add(LRN2D(3, alpha=0.00005, beta=0.75))
+
+m.add(Convolution(64, 5, 1, 2, w_param=parw, b_param=parb, b_lr=1))
+m.add(Activation('relu'))
+m.add(AvgPooling2D(pool_size(3,3), stride=2))
+
+m.add(Dense(10, w_param=parw, w_wd=250, b_param=parb, b_lr=2, b_wd=0, activation='softmax'))
+</pre></div></div>
+<p>Data can be added in this way,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">X_train, X_test = mnist.load_data()
 // parameter values are set in load_data()
+m.fit(X_train, ...)                  // Data layer for training is added
+m.evaluate(X_test, ...)              // Data layer for testing is added
+</pre></div></div>
+<p>or this way,</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">X_train, X_test = mnist.load_data()
 // parameter values are set in load_data()
+m.add(X_train)                       // explicitly add Data layer
+m.add(X_test)                        // explicitly add Data layer
+</pre></div></div>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">store = Store(path='train.bin',
batch_size=64, ...)        // parameter values are set explicitly
+m.add(Data(load='recordinput', phase='train', conf=store)) // Data layer is added
+store = Store(path='test.bin', batch_size=100, ...)        // parameter values are set explicitly
+m.add(Data(load='recordinput', phase='test', conf=store))  // Data layer is added
+</pre></div></div></div>
+<div class="section">
+<h3><a name="Cases_to_run_SINGA"></a>Cases to run SINGA</h3>
+<p>(1) Run SINGA for training</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">m.fit(X_train, nb_epoch=1000)
+</pre></div></div>
+<p>(2) Run SINGA for training and validation</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">m.fit(X_train, validate_data=X_valid,
nb_epoch=1000)
+</pre></div></div>
+<p>(3) Run SINGA for test while training</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">m.fit(X_train, nb_epoch=1000, with_test=True)
+result = m.evaluate(X_test, batch_size=100, test_steps=100)
+</pre></div></div>
+<p>(4) Run SINGA for test only Assume a checkpoint exists after training</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">result = m.evaluate(X_test, batch_size=100,
checkpoint_path=workspace+'/checkpoint/step100-worker0')
+</pre></div></div></div></div>
+<div class="section">
+<h2><a name="Implementation_Details"></a>Implementation Details</h2>
+<div class="section">
+<h3><a name="Layer_class_inherited"></a>Layer class (inherited)</h3>
+
+<ul>
+  
+<li>Data</li>
+  
+<li>Dense</li>
+  
+<li>Activation</li>
+  
+<li>Convolution2D</li>
+  
+<li>MaxPooling2D</li>
+  
+<li>AvgPooling2D</li>
+  
+<li>LRN2D</li>
+  
+<li>Dropout</li>
+  
+<li>RBM</li>
+  
+<li>Autoencoder</li>
+</ul></div>
+<div class="section">
+<h3><a name="Model_class"></a>Model class</h3>
+<p>Model class has <tt>jobconf</tt> (JobProto) and <tt>layers</tt>
(layer list)</p>
+<p>Methods in Model class</p>
+
+<ul>
+  
+<li>
+<p>add</p>
+  
+<ul>
+    
+<li>add Layer into Model</li>
+    
+<li>2 subclasses: Sequential model and Energy model</li>
+  </ul></li>
+  
+<li>
+<p>compile</p>
+  
+<ul>
+    
+<li>set Updater (i.e., optimizer) and Cluster (i.e., topology) components</li>
+  </ul></li>
+  
+<li>
+<p>fit</p>
+  
+<ul>
+    
+<li>set Training data and parameter values for the training
+    
+<ul>
+      
+<li>(optional) set Validatiaon data and parameter values</li>
+    </ul></li>
+    
+<li>set Train_one_batch component</li>
+    
+<li>specify <tt>with_test</tt> field if a user wants to run SINGA with
test data simultaneously.</li>
+    
+<li>[TODO] recieve train/validation results, e.g., accuracy, loss, ppl, etc.</li>
+  </ul></li>
+  
+<li>
+<p>evaluate</p>
+  
+<ul>
+    
+<li>set Testing data and parameter values for the testing</li>
+    
+<li>specify <tt>checkpoint_path</tt> field if a user want to run SINGA
only for testing.</li>
+    
+<li>[TODO] recieve test results, e.g., accuracy, loss, ppl, etc.</li>
+  </ul></li>
+</ul></div>
+<div class="section">
+<h3><a name="Results"></a>Results</h3>
+<p>fit() and evaluate() return train/test results, a dictionary containing</p>
+
+<ul>
+  
+<li>[key]: step number</li>
+  
+<li>[value]: a list of dictionay
+  
+<ul>
+    
+<li>&#x2018;acc&#x2019; for accuracy</li>
+    
+<li>&#x2018;loss&#x2019; for loss</li>
+    
+<li>&#x2018;ppl&#x2019; for ppl</li>
+    
+<li>&#x2018;se&#x2019; for squred error</li>
+  </ul></li>
+</ul></div>
+<div class="section">
+<h3><a name="Parameter_class"></a>Parameter class</h3>
+<p>Users need to set parameter and initial values. For example,</p>
+
+<ul>
+  
+<li>
+<p>Parameter (fields in Param proto)</p>
+  
+<ul>
+    
+<li>lr = (float) // learning rate multiplier, used to scale the learning rate when
updating parameters.</li>
+    
+<li>wd = (float) // weight decay multiplier, used to scale the weight decay when updating
parameters.</li>
+  </ul></li>
+  
+<li>
+<p>Parameter initialization (fields in ParamGen proto)</p>
+  
+<ul>
+    
+<li>init = (string) // one of the types, &#x2018;uniform&#x2019;, &#x2018;constant&#x2019;,
&#x2018;gaussian&#x2019;</li>
+    
+<li>high = (float) // for &#x2018;uniform&#x2019;</li>
+    
+<li>low = (float) // for &#x2018;uniform&#x2019;</li>
+    
+<li>value = (float) // for &#x2018;constant&#x2019;</li>
+    
+<li>mean = (float) // for &#x2018;gaussian&#x2019;</li>
+    
+<li>std = (float) // for &#x2018;gaussian&#x2019;</li>
+  </ul></li>
+  
+<li>
+<p>Weight (<tt>w_param</tt>) is &#x2018;gaussian&#x2019; with mean=0,
std=0.01 at default</p></li>
+  
+<li>
+<p>Bias (<tt>b_param</tt>) is &#x2018;constant&#x2019; with value=0
at default</p></li>
+  
+<li>
+<p>How to update the parameter fields</p>
+  
+<ul>
+    
+<li>for updating Weight, put <tt>w_</tt> in front of field name</li>
+    
+<li>for updating Bias, put <tt>b_</tt> in front of field name</li>
+  </ul></li>
+</ul>
+<p>Several ways to set Parameter values</p>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">parw = Parameter(lr=2, wd=10, init='gaussian',
std=0.1)
+parb = Parameter(lr=1, wd=0, init='constant', value=0)
+m.add(Convolution2D(10, w_param=parw, b_param=parb, ...)
+</pre></div></div>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">m.add(Dense(10, w_mean=1, w_std=0.1,
w_lr=2, w_wd=10, ...)
+</pre></div></div>
+
+<div class="source">
+<div class="source"><pre class="prettyprint">parw = Parameter(init='constant',
mean=0)
+m.add(Dense(10, w_param=parw, w_lr=1, w_wd=1, b_value=1, ...)
+</pre></div></div></div>
+<div class="section">
+<h3><a name="Other_classes"></a>Other classes</h3>
+
+<ul>
+  
+<li>Store</li>
+  
+<li>Algorithm</li>
+  
+<li>Updater</li>
+  
+<li>SGD</li>
+  
+<li>AdaGrad</li>
+  
+<li>Cluster</li>
+</ul></div></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>

Modified: websites/staging/singa/trunk/content/downloads.html
==============================================================================
--- websites/staging/singa/trunk/content/downloads.html (original)
+++ websites/staging/singa/trunk/content/downloads.html Fri Jan  8 09:42:34 2016
@@ -335,15 +335,15 @@
     
 <ul>
       
-<li><a href="../docs/gpu.html">Training on GPU</a> enables training of
complex models on a single node with multiple GPU cards.</li>
+<li><a href="docs/gpu.html">Training on GPU</a> enables training of complex
models on a single node with multiple GPU cards.</li>
       
-<li><a href="../docs/frameworks.html">Hybrid neural net partitioning</a>
supports data and model parallelism at the same time.</li>
+<li><a href="docs/frameworks.html">Hybrid neural net partitioning</a> supports
data and model parallelism at the same time.</li>
       
-<li><a href="../docs/python.html">Python wrapper</a> makes it easy to configure
the job, including neural net and SGD algorithm.</li>
+<li><a href="docs/python.html">Python wrapper</a> makes it easy to configure
the job, including neural net and SGD algorithm.</li>
       
-<li><a href="../docs/rnn.html">RNN model and BPTT algorithm</a> are implemented
to support applications based on RNN models, e.g., GRU.</li>
+<li><a href="docs/rnn.html">RNN model and BPTT algorithm</a> are implemented
to support applications based on RNN models, e.g., GRU.</li>
       
-<li><a href="../docs/distributed-training.md">Cloud software integration</a>
includes Mesos, Docker and HDFS.</li>
+<li><a href="docs/distributed-training.html">Cloud software integration</a>
includes Mesos, Docker and HDFS.</li>
     </ul></li>
   </ul></li>
 </ul>



Mime
View raw message