Added: incubator/singa/site/trunk/en/docs/optimizer.html URL: http://svn.apache.org/viewvc/incubator/singa/site/trunk/en/docs/optimizer.html?rev=1858059&view=auto ============================================================================== --- incubator/singa/site/trunk/en/docs/optimizer.html (added) +++ incubator/singa/site/trunk/en/docs/optimizer.html Wed Apr 24 14:57:35 2019 @@ -0,0 +1,694 @@ + + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Optimizer — incubator-singa 1.1.0 documentation</title> + + + + + + + + + <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="Autograd in Singa" href="autograd.html" /> + <link rel="prev" title="Metric" href="metric.html" /> + <link href="../_static/style.css" rel="stylesheet" type="text/css"> + <!--link href="../_static/fontawesome-all.min.css" rel="stylesheet" type="text/css"--> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"> + <style> + .fa:hover { + opacity: 0.7; + } + .fab:hover { + opacity: 0.7; + } + </style> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + + + + <a href="../index.html" class="icon icon-home"> incubator-singa + + + + + <img src="../_static/singa.png" class="logo" alt="Logo"/> + + </a> + + + + + <div class="version"> + latest + </div> + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Documentation</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li> +<li class="toctree-l2"><a class="reference internal" href="software_stack.html">Software Stack</a></li> +<li class="toctree-l2"><a class="reference internal" href="device.html">Device</a></li> +<li class="toctree-l2"><a class="reference internal" href="tensor.html">Tensor</a></li> +<li class="toctree-l2"><a class="reference internal" href="layer.html">Layer</a></li> +<li class="toctree-l2"><a class="reference internal" href="net.html">FeedForward Net</a></li> +<li class="toctree-l2"><a class="reference internal" href="initializer.html">Initializer</a></li> +<li class="toctree-l2"><a class="reference internal" href="loss.html">Loss</a></li> +<li class="toctree-l2"><a class="reference internal" href="metric.html">Metric</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Optimizer</a></li> +<li class="toctree-l2"><a class="reference internal" href="autograd.html">Autograd in Singa</a></li> +<li class="toctree-l2"><a class="reference internal" href="data.html">Data</a></li> +<li class="toctree-l2"><a class="reference internal" href="image_tool.html">Image Tool</a></li> +<li class="toctree-l2"><a class="reference internal" href="snapshot.html">Snapshot</a></li> +<li class="toctree-l2"><a class="reference internal" href="converter.html">Caffe Converter</a></li> +<li class="toctree-l2"><a class="reference internal" href="utils.html">Utils</a></li> +<li class="toctree-l2"><a class="reference internal" href="model_zoo/index.html">Model Zoo</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../downloads.html">Download SINGA</a></li> +</ul> +<p class="caption"><span class="caption-text">Development</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../develop/schedule.html">Development Schedule</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html">How to Contribute to SINGA</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html#how-to-become-a-singa-committer">How to become a SINGA committer</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-code.html">How to Contribute Code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-docs.html">How to Contribute to Documentation</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-to-release.html">How to prepare a release</a></li> +</ul> +<p class="caption"><span class="caption-text">Community</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../community/source-repository.html">Source Repository</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/mail-lists.html">Project Mailing Lists</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/issue-tracking.html">Issue Tracking</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/team-list.html">The SINGA Team</a></li> +</ul> + + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">incubator-singa</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">Documentation</a> »</li> + + <li>Optimizer</li> + + + <li class="wy-breadcrumbs-aside"> + + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <div class="section" id="module-singa.optimizer"> +<span id="optimizer"></span><h1>Optimizer<a class="headerlink" href="#module-singa.optimizer" title="Permalink to this headline">¶</a></h1> +<p>This module includes a set of optimizers for updating model parameters.</p> +<p>Example usage:</p> +<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">singa</span> <span class="k">import</span> <span class="n">optimizer</span> +<span class="kn">from</span> <span class="nn">singa</span> <span class="k">import</span> <span class="n">tensor</span> + +<span class="n">sgd</span> <span class="o">=</span> <span class="n">optimizer</span><span class="o">.</span><span class="n">SGD</span><span class="p">(</span><span class="n">lr</span><span class="o">=</span><span class="mf">0.01</span><span class="p">,</span> <span class="n">momentum</span><span class="o">=</span><span class="mf">0.9</span><span class="p">,</span> <span class="n">weight_decay</span><span class="o">=</span><span class="mf">1e-4</span><span class="p">)</span> +<span class="n">p</span> <span class="o">=</span> <span class="n">tensor</span><span class="o">.</span><span class="n">Tensor</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span><span class="mi">5</span><span class="p">))</span> +<span class="n">p</span><span class="o">.</span><span class="n">uniform</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> +<span class="n">g</span> <span class="o">=</span> <span class="n">tensor</span><span class="o">.</span><span class="n">Tensor</span><span class="p">((</span><span class="mi">3</span><span class="p">,</span><span class="mi">5</span><span class="p">))</span> +<span class="n">g</span><span class="o">.</span><span class="n">gaussian</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mf">0.01</span><span class="p">)</span> + +<span class="n">sgd</span><span class="o">.</span><span class="n">apply</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">g</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="s1">'param'</span><span class="p">)</span> <span class="c1"># use the global lr=0.1 for epoch 1</span> +<span class="n">sgd</span><span class="o">.</span><span class="n">apply_with_lr</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mf">0.03</span><span class="p">,</span> <span class="n">g</span><span class="p">,</span> <span class="n">p</span><span class="p">,</span> <span class="s1">'param'</span><span class="p">)</span> <span class="c1"># use lr=0.03 for epoch 2</span> +</pre></div> +</div> +<dl class="class"> +<dt id="singa.optimizer.Optimizer"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">Optimizer</code><span class="sig-paren">(</span><em>lr=None</em>, <em>momentum=None</em>, <em>weight_decay=None</em>, <em>regularizer=None</em>, <em>constraint=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Optimizer" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>The base python optimizer class.</p> +<p>Typically, an optimizer is used as follows:</p> +<ol class="arabic simple"> +<li><p>construct the optimizer</p></li> +<li><p>(optional) register each parameter with its specs.</p></li> +<li><p>use the optimizer to update parameter values given parameter gradients +and other optional info</p></li> +</ol> +<p>The subclasses should override the apply_with_lr function to do the real +parameter udpate.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>lr</strong> (<em>float</em>) â a constant value for the learning rate</p></li> +<li><p><strong>momentum</strong> (<em>float</em>) â a constant value for the momentum value</p></li> +<li><p><strong>weight_decay</strong> (<em>float</em>) â the coefficent for L2 regularizer, which is +mutually exclusive with âregularizerâ.</p></li> +<li><p><strong>regularizer</strong> â an instance of Regularizer or RegularizerConf; If set, +regularization would be applied in apply_with_lr(). +Users can also do regularization outside.</p></li> +<li><p><strong>constraint</strong> â an instance of Constraint or ConstraintConf; If set, +constraint would be applied inside apply_with_lr(). Users can +also apply constraint outside.</p></li> +</ul> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.Optimizer.register"> +<code class="descname">register</code><span class="sig-paren">(</span><em>name</em>, <em>specs</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Optimizer.register" title="Permalink to this definition">¶</a></dt> +<dd><p>Register the param specs, including creating regularizer and +constraint per param object. Param specific regularizer and constraint +have higher priority than the global ones. If all parameters share the +same setting for learning rate, regularizer and constraint, then there +is no need to call this function.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>name</strong> (<em>str</em>) â parameter name</p></li> +<li><p><strong>specs</strong> (<em>ParamSpec</em>) â protobuf obj, including regularizer and +constraint, multipliers for learning rate and weight decay.</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="singa.optimizer.Optimizer.apply_regularizer_constraint"> +<code class="descname">apply_regularizer_constraint</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>name=None</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Optimizer.apply_regularizer_constraint" title="Permalink to this definition">¶</a></dt> +<dd><p>Apply regularization and constraint if available.</p> +<p>If there are both global regularizer (constraint) and param specific +regularizer (constraint), it would use the param specific one.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>value</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter value Tensor</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient Tensor</p></li> +<li><p><strong>name</strong> (<em>string</em>) â to get parameter specific regularizer or constraint</p></li> +<li><p><strong>step</strong> (<em>int</em>) â iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>the updated gradient Tensor</p> +</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="singa.optimizer.Optimizer.apply_with_lr"> +<code class="descname">apply_with_lr</code><span class="sig-paren">(</span><em>epoch</em>, <em>lr</em>, <em>grad</em>, <em>value</em>, <em>name=None</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Optimizer.apply_with_lr" title="Permalink to this definition">¶</a></dt> +<dd><p>Do update of parameters with given learning rate if the grad is not +empty.</p> +<p>The subclass optimizer must override this function. +This function do nothing if the grad is empty.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>lr</strong> (<em>float</em>) â learning rate</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient</p></li> +<li><p><strong>value</strong> (<em>Tesnor</em>) â parameter value</p></li> +<li><p><strong>name</strong> (<em>string</em>) â paramter name to index parameter specific +updating rules (including regularizer and constraint)</p></li> +<li><p><strong>step</strong> (<em>int</em>) â iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>updated parameter value</p> +</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="singa.optimizer.Optimizer.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>grad</em>, <em>value</em>, <em>name=None</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Optimizer.apply" title="Permalink to this definition">¶</a></dt> +<dd><p>Do update assuming the learning rate generator is set.</p> +<p>The subclass optimizer does not need to override this function.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient</p></li> +<li><p><strong>value</strong> (<em>Tesnor</em>) â parameter value</p></li> +<li><p><strong>name</strong> (<em>string</em>) â paramter name to retrieval parameter specific +updating rules (including regularizer and constraint)</p></li> +<li><p><strong>step</strong> (<em>int</em>) â training iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>updated parameter value</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.SGD"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">SGD</code><span class="sig-paren">(</span><em>lr=None</em>, <em>momentum=None</em>, <em>weight_decay=None</em>, <em>regularizer=None</em>, <em>constraint=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.SGD" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Optimizer" title="singa.optimizer.Optimizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Optimizer</span></code></a></p> +<p>The vallina Stochasitc Gradient Descent algorithm with momentum.</p> +<p>See the base Optimizer for all arguments.</p> +<dl class="method"> +<dt id="singa.optimizer.SGD.apply_with_lr"> +<code class="descname">apply_with_lr</code><span class="sig-paren">(</span><em>epoch</em>, <em>lr</em>, <em>grad</em>, <em>value</em>, <em>name</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.SGD.apply_with_lr" title="Permalink to this definition">¶</a></dt> +<dd><p>Do update of parameters with given learning rate if the grad is not +empty.</p> +<p>The subclass optimizer must override this function. +This function do nothing if the grad is empty.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>lr</strong> (<em>float</em>) â learning rate</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient</p></li> +<li><p><strong>value</strong> (<em>Tesnor</em>) â parameter value</p></li> +<li><p><strong>name</strong> (<em>string</em>) â paramter name to index parameter specific +updating rules (including regularizer and constraint)</p></li> +<li><p><strong>step</strong> (<em>int</em>) â iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>updated parameter value</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.Nesterov"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">Nesterov</code><span class="sig-paren">(</span><em>lr=None</em>, <em>momentum=0.9</em>, <em>weight_decay=None</em>, <em>regularizer=None</em>, <em>constraint=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Nesterov" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Optimizer" title="singa.optimizer.Optimizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Optimizer</span></code></a></p> +<p>The SGD with Nesterov momentum.</p> +<p>See the base Optimizer for all arguments.</p> +<dl class="method"> +<dt id="singa.optimizer.Nesterov.apply_with_lr"> +<code class="descname">apply_with_lr</code><span class="sig-paren">(</span><em>epoch</em>, <em>lr</em>, <em>grad</em>, <em>value</em>, <em>name</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Nesterov.apply_with_lr" title="Permalink to this definition">¶</a></dt> +<dd><p>Do update of parameters with given learning rate if the grad is not +empty.</p> +<p>The subclass optimizer must override this function. +This function do nothing if the grad is empty.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>lr</strong> (<em>float</em>) â learning rate</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient</p></li> +<li><p><strong>value</strong> (<em>Tesnor</em>) â parameter value</p></li> +<li><p><strong>name</strong> (<em>string</em>) â paramter name to index parameter specific +updating rules (including regularizer and constraint)</p></li> +<li><p><strong>step</strong> (<em>int</em>) â iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>updated parameter value</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.RMSProp"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">RMSProp</code><span class="sig-paren">(</span><em>rho=0.9</em>, <em>epsilon=1e-08</em>, <em>lr=None</em>, <em>weight_decay=None</em>, <em>regularizer=None</em>, <em>constraint=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.RMSProp" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Optimizer" title="singa.optimizer.Optimizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Optimizer</span></code></a></p> +<p>RMSProp optimizer.</p> +<p>See the base Optimizer for all constructor args.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>rho</strong> (<em>float</em>) â float within [0, 1]</p></li> +<li><p><strong>epsilon</strong> (<em>float</em>) â small value for preventing numeric error</p></li> +</ul> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.RMSProp.apply_with_lr"> +<code class="descname">apply_with_lr</code><span class="sig-paren">(</span><em>epoch</em>, <em>lr</em>, <em>grad</em>, <em>value</em>, <em>name</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.RMSProp.apply_with_lr" title="Permalink to this definition">¶</a></dt> +<dd><p>Do update of parameters with given learning rate if the grad is not +empty.</p> +<p>The subclass optimizer must override this function. +This function do nothing if the grad is empty.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>lr</strong> (<em>float</em>) â learning rate</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient</p></li> +<li><p><strong>value</strong> (<em>Tesnor</em>) â parameter value</p></li> +<li><p><strong>name</strong> (<em>string</em>) â paramter name to index parameter specific +updating rules (including regularizer and constraint)</p></li> +<li><p><strong>step</strong> (<em>int</em>) â iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>updated parameter value</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.AdaGrad"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">AdaGrad</code><span class="sig-paren">(</span><em>epsilon=1e-08</em>, <em>lr=None</em>, <em>weight_decay=None</em>, <em>lr_gen=None</em>, <em>regularizer=None</em>, <em>constraint=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.AdaGrad" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Optimizer" title="singa.optimizer.Optimizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Optimizer</span></code></a></p> +<p>AdaGrad optimizer.</p> +<p>See the base Optimizer for all constructor args.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>epsilon</strong> (<em>float</em>) â small number for preventing numeric error.</p> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.AdaGrad.apply_with_lr"> +<code class="descname">apply_with_lr</code><span class="sig-paren">(</span><em>epoch</em>, <em>lr</em>, <em>grad</em>, <em>value</em>, <em>name</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.AdaGrad.apply_with_lr" title="Permalink to this definition">¶</a></dt> +<dd><p>Do update of parameters with given learning rate if the grad is not +empty.</p> +<p>The subclass optimizer must override this function. +This function do nothing if the grad is empty.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>epoch</strong> (<em>int</em>) â training epoch ID</p></li> +<li><p><strong>lr</strong> (<em>float</em>) â learning rate</p></li> +<li><p><strong>grad</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â parameter gradient</p></li> +<li><p><strong>value</strong> (<em>Tesnor</em>) â parameter value</p></li> +<li><p><strong>name</strong> (<em>string</em>) â paramter name to index parameter specific +updating rules (including regularizer and constraint)</p></li> +<li><p><strong>step</strong> (<em>int</em>) â iteration ID within one epoch</p></li> +</ul> +</dd> +<dt class="field-even">Returns</dt> +<dd class="field-even"><p>updated parameter value</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.Adam"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">Adam</code><span class="sig-paren">(</span><em>beta_1=0.9</em>, <em>beta_2=0.999</em>, <em>epsilon=1e-08</em>, <em>lr=None</em>, <em>weight_decay=None</em>, <em>regularizer=None</em>, <em>constraint=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Adam" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Optimizer" title="singa.optimizer.Optimizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Optimizer</span></code></a></p> +<p>Adam optimizer.</p> +<p>See the base Optimizer for all constructor args.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>beta_1</strong> (<em>float</em>) â coefficient of momentum</p></li> +<li><p><strong>beta_2</strong> (<em>float</em>) â coefficient of aggregated squared gradient</p></li> +<li><p><strong>epsilon</strong> (<em>float</em>) â small value for preventing numeric error</p></li> +</ul> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.Adam.apply_with_lr"> +<code class="descname">apply_with_lr</code><span class="sig-paren">(</span><em>epoch</em>, <em>lr</em>, <em>grad</em>, <em>value</em>, <em>name</em>, <em>step</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Adam.apply_with_lr" title="Permalink to this definition">¶</a></dt> +<dd><p>Update one parameter object.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>step</strong> (<em>int</em>) â the accumulated training iterations, not the iteration ID</p> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.Regularizer"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">Regularizer</code><a class="headerlink" href="#singa.optimizer.Regularizer" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Base Python regularizer for parameter gradients.</p> +<dl class="method"> +<dt id="singa.optimizer.Regularizer.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Regularizer.apply" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.CppRegularizer"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">CppRegularizer</code><span class="sig-paren">(</span><em>conf</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.CppRegularizer" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Regularizer" title="singa.optimizer.Regularizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Regularizer</span></code></a></p> +<p>Wrapper for regularizer implemented using C++.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>conf</strong> (<em>RegularizerConf</em>) â protobuf message for the configuration.</p> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.CppRegularizer.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.CppRegularizer.apply" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.L2Regularizer"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">L2Regularizer</code><span class="sig-paren">(</span><em>coefficient</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.L2Regularizer" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Regularizer" title="singa.optimizer.Regularizer"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Regularizer</span></code></a></p> +<p>L2 regularization</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>coefficient</strong> (<em>float</em>) â regularization coefficient.</p> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.L2Regularizer.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.L2Regularizer.apply" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.Constraint"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">Constraint</code><a class="headerlink" href="#singa.optimizer.Constraint" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Base Python constraint class for paramter gradients</p> +<dl class="method"> +<dt id="singa.optimizer.Constraint.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.Constraint.apply" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.CppConstraint"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">CppConstraint</code><span class="sig-paren">(</span><em>conf</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.CppConstraint" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Constraint" title="singa.optimizer.Constraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Constraint</span></code></a></p> +<p>Wrapper for constraints implemented using C++.</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><p><strong>conf</strong> (<em>ConstraintConf</em>) â protobuf message for the configuration.</p> +</dd> +</dl> +<dl class="method"> +<dt id="singa.optimizer.CppConstraint.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.CppConstraint.apply" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +<dl class="class"> +<dt id="singa.optimizer.L2Constraint"> +<em class="property">class </em><code class="descclassname">singa.optimizer.</code><code class="descname">L2Constraint</code><span class="sig-paren">(</span><em>threshold=None</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.L2Constraint" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <a class="reference internal" href="#singa.optimizer.Constraint" title="singa.optimizer.Constraint"><code class="xref py py-class docutils literal notranslate"><span class="pre">singa.optimizer.Constraint</span></code></a></p> +<p>Rescale the gradient to make the L2 norm <= a given threshold</p> +<dl class="method"> +<dt id="singa.optimizer.L2Constraint.apply"> +<code class="descname">apply</code><span class="sig-paren">(</span><em>epoch</em>, <em>value</em>, <em>grad</em>, <em>step=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.optimizer.L2Constraint.apply" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +</div> + + + </div> + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="autograd.html" class="btn btn-neutral float-right" title="Autograd in Singa" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="metric.html" class="btn btn-neutral float-left" title="Metric" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019 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> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + + + + + + +<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> + <span class="rst-current-version" data-toggle="rst-current-version"> + <span class="fa fa-book"> incubator-singa </span> + v: latest + <span class="fa fa-caret-down"></span> + </span> + <div class="rst-other-versions"> + <dl> + <dt>Languages</dt> + <dd><a href="../../en/index.html">English</a></dd> + <dd><a href="../../zh/index.html">䏿</a></dd> + </dl> + <dl> + <dt>Versions</dt> + <dd><a href="http://singa.apache.org/v0.3.0/">0.3</a></dd> + <dd><a href="http://singa.apache.org/v1.1.0/">1.1</a></dd> + </dl> + + </div> + <a href="http://incubator.apache.org/"> <img src= "../_static/apache.png" style="background-color:white;"> </a> + + <a href="https://github.com/apache/incubator-singa" class="fa fa-github" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://aws.amazon.com/marketplace/seller-profile?id=5bcac385-12c4-4802-aec7-351e09b77b4c" class="fab fa-aws" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://hub.docker.com/r/apache/singa/" class="fab fa-docker" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.linkedin.com/groups/13550034" class="fa fa-linkedin" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://twitter.com/ApacheSinga" class="fa fa-twitter" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.facebook.com/Apache-SINGA-347284219056544/" class="fa fa-facebook" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.researchgate.net/project/Apache-SINGA" class="fab fa-researchgate" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + +</div> + + <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> + + + + +</body> +</html> \ No newline at end of file
Added: incubator/singa/site/trunk/en/docs/security.html URL: http://svn.apache.org/viewvc/incubator/singa/site/trunk/en/docs/security.html?rev=1858059&view=auto ============================================================================== --- incubator/singa/site/trunk/en/docs/security.html (added) +++ incubator/singa/site/trunk/en/docs/security.html Wed Apr 24 14:57:35 2019 @@ -0,0 +1,301 @@ + + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Security — incubator-singa 1.1.0 documentation</title> + + + + + + + + + <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="Download SINGA" href="../downloads.html" /> + <link rel="prev" title="name: VGG models on ImageNet SINGA version: 1.1.1 SINGA commit: license: https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py" href="model_zoo/imagenet/vgg/README.html" /> + <link href="../_static/style.css" rel="stylesheet" type="text/css"> + <!--link href="../_static/fontawesome-all.min.css" rel="stylesheet" type="text/css"--> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"> + <style> + .fa:hover { + opacity: 0.7; + } + .fab:hover { + opacity: 0.7; + } + </style> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + + + + <a href="../index.html" class="icon icon-home"> incubator-singa + + + + + <img src="../_static/singa.png" class="logo" alt="Logo"/> + + </a> + + + + + <div class="version"> + latest + </div> + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Documentation</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li> +<li class="toctree-l2"><a class="reference internal" href="software_stack.html">Software Stack</a></li> +<li class="toctree-l2"><a class="reference internal" href="device.html">Device</a></li> +<li class="toctree-l2"><a class="reference internal" href="tensor.html">Tensor</a></li> +<li class="toctree-l2"><a class="reference internal" href="layer.html">Layer</a></li> +<li class="toctree-l2"><a class="reference internal" href="net.html">FeedForward Net</a></li> +<li class="toctree-l2"><a class="reference internal" href="initializer.html">Initializer</a></li> +<li class="toctree-l2"><a class="reference internal" href="loss.html">Loss</a></li> +<li class="toctree-l2"><a class="reference internal" href="metric.html">Metric</a></li> +<li class="toctree-l2"><a class="reference internal" href="optimizer.html">Optimizer</a></li> +<li class="toctree-l2"><a class="reference internal" href="autograd.html">Autograd in Singa</a></li> +<li class="toctree-l2"><a class="reference internal" href="data.html">Data</a></li> +<li class="toctree-l2"><a class="reference internal" href="image_tool.html">Image Tool</a></li> +<li class="toctree-l2"><a class="reference internal" href="snapshot.html">Snapshot</a></li> +<li class="toctree-l2"><a class="reference internal" href="converter.html">Caffe Converter</a></li> +<li class="toctree-l2"><a class="reference internal" href="utils.html">Utils</a></li> +<li class="toctree-l2"><a class="reference internal" href="model_zoo/index.html">Model Zoo</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Security</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../downloads.html">Download SINGA</a></li> +</ul> +<p class="caption"><span class="caption-text">Development</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../develop/schedule.html">Development Schedule</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html">How to Contribute to SINGA</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html#how-to-become-a-singa-committer">How to become a SINGA committer</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-code.html">How to Contribute Code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-docs.html">How to Contribute to Documentation</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-to-release.html">How to prepare a release</a></li> +</ul> +<p class="caption"><span class="caption-text">Community</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../community/source-repository.html">Source Repository</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/mail-lists.html">Project Mailing Lists</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/issue-tracking.html">Issue Tracking</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/team-list.html">The SINGA Team</a></li> +</ul> + + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">incubator-singa</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">Documentation</a> »</li> + + <li>Security</li> + + + <li class="wy-breadcrumbs-aside"> + + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <div class="section" id="security"> +<h1>Security<a class="headerlink" href="#security" title="Permalink to this headline">¶</a></h1> +<p>Users can report security vulnerabilities to Apache Security Team: <a class="reference external" href="http://www.apache.org/security/">http://www.apache.org/security/</a></p> +<p>SINGA is creating a new team for security. More details will be added soon.</p> +</div> + + + </div> + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="../downloads.html" class="btn btn-neutral float-right" title="Download SINGA" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="model_zoo/imagenet/vgg/README.html" class="btn btn-neutral float-left" title="name: VGG models on ImageNet SINGA version: 1.1.1 SINGA commit: license: https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019 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> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + + + + + + +<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> + <span class="rst-current-version" data-toggle="rst-current-version"> + <span class="fa fa-book"> incubator-singa </span> + v: latest + <span class="fa fa-caret-down"></span> + </span> + <div class="rst-other-versions"> + <dl> + <dt>Languages</dt> + <dd><a href="../../en/index.html">English</a></dd> + <dd><a href="../../zh/index.html">䏿</a></dd> + </dl> + <dl> + <dt>Versions</dt> + <dd><a href="http://singa.apache.org/v0.3.0/">0.3</a></dd> + <dd><a href="http://singa.apache.org/v1.1.0/">1.1</a></dd> + </dl> + + </div> + <a href="http://incubator.apache.org/"> <img src= "../_static/apache.png" style="background-color:white;"> </a> + + <a href="https://github.com/apache/incubator-singa" class="fa fa-github" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://aws.amazon.com/marketplace/seller-profile?id=5bcac385-12c4-4802-aec7-351e09b77b4c" class="fab fa-aws" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://hub.docker.com/r/apache/singa/" class="fab fa-docker" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.linkedin.com/groups/13550034" class="fa fa-linkedin" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://twitter.com/ApacheSinga" class="fa fa-twitter" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.facebook.com/Apache-SINGA-347284219056544/" class="fa fa-facebook" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.researchgate.net/project/Apache-SINGA" class="fab fa-researchgate" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + +</div> + + <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> + + + + +</body> +</html> \ No newline at end of file Added: incubator/singa/site/trunk/en/docs/snapshot.html URL: http://svn.apache.org/viewvc/incubator/singa/site/trunk/en/docs/snapshot.html?rev=1858059&view=auto ============================================================================== --- incubator/singa/site/trunk/en/docs/snapshot.html (added) +++ incubator/singa/site/trunk/en/docs/snapshot.html Wed Apr 24 14:57:35 2019 @@ -0,0 +1,342 @@ + + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Snapshot — incubator-singa 1.1.0 documentation</title> + + + + + + + + + <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="Caffe Converter" href="converter.html" /> + <link rel="prev" title="Image Tool" href="image_tool.html" /> + <link href="../_static/style.css" rel="stylesheet" type="text/css"> + <!--link href="../_static/fontawesome-all.min.css" rel="stylesheet" type="text/css"--> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"> + <style> + .fa:hover { + opacity: 0.7; + } + .fab:hover { + opacity: 0.7; + } + </style> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + + + + <a href="../index.html" class="icon icon-home"> incubator-singa + + + + + <img src="../_static/singa.png" class="logo" alt="Logo"/> + + </a> + + + + + <div class="version"> + latest + </div> + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Documentation</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li> +<li class="toctree-l2"><a class="reference internal" href="software_stack.html">Software Stack</a></li> +<li class="toctree-l2"><a class="reference internal" href="device.html">Device</a></li> +<li class="toctree-l2"><a class="reference internal" href="tensor.html">Tensor</a></li> +<li class="toctree-l2"><a class="reference internal" href="layer.html">Layer</a></li> +<li class="toctree-l2"><a class="reference internal" href="net.html">FeedForward Net</a></li> +<li class="toctree-l2"><a class="reference internal" href="initializer.html">Initializer</a></li> +<li class="toctree-l2"><a class="reference internal" href="loss.html">Loss</a></li> +<li class="toctree-l2"><a class="reference internal" href="metric.html">Metric</a></li> +<li class="toctree-l2"><a class="reference internal" href="optimizer.html">Optimizer</a></li> +<li class="toctree-l2"><a class="reference internal" href="autograd.html">Autograd in Singa</a></li> +<li class="toctree-l2"><a class="reference internal" href="data.html">Data</a></li> +<li class="toctree-l2"><a class="reference internal" href="image_tool.html">Image Tool</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Snapshot</a></li> +<li class="toctree-l2"><a class="reference internal" href="converter.html">Caffe Converter</a></li> +<li class="toctree-l2"><a class="reference internal" href="utils.html">Utils</a></li> +<li class="toctree-l2"><a class="reference internal" href="model_zoo/index.html">Model Zoo</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../downloads.html">Download SINGA</a></li> +</ul> +<p class="caption"><span class="caption-text">Development</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../develop/schedule.html">Development Schedule</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html">How to Contribute to SINGA</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html#how-to-become-a-singa-committer">How to become a SINGA committer</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-code.html">How to Contribute Code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-docs.html">How to Contribute to Documentation</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-to-release.html">How to prepare a release</a></li> +</ul> +<p class="caption"><span class="caption-text">Community</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../community/source-repository.html">Source Repository</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/mail-lists.html">Project Mailing Lists</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/issue-tracking.html">Issue Tracking</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/team-list.html">The SINGA Team</a></li> +</ul> + + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">incubator-singa</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">Documentation</a> »</li> + + <li>Snapshot</li> + + + <li class="wy-breadcrumbs-aside"> + + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <div class="section" id="module-singa.snapshot"> +<span id="snapshot"></span><h1>Snapshot<a class="headerlink" href="#module-singa.snapshot" title="Permalink to this headline">¶</a></h1> +<p>This script includes io::snapshot class and its methods.</p> +<p>Example usages:</p> +<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">singa</span> <span class="k">import</span> <span class="n">snapshot</span> + +<span class="n">sn1</span> <span class="o">=</span> <span class="n">snapshot</span><span class="o">.</span><span class="n">Snapshot</span><span class="p">(</span><span class="s1">'param'</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> +<span class="n">params</span> <span class="o">=</span> <span class="n">sn1</span><span class="o">.</span><span class="n">read</span><span class="p">()</span> <span class="c1"># read all params as a dictionary</span> + +<span class="n">sn2</span> <span class="o">=</span> <span class="n">snapshot</span><span class="o">.</span><span class="n">Snapshot</span><span class="p">(</span><span class="s1">'param_new'</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> +<span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">params</span><span class="o">.</span><span class="n">iteritems</span><span class="p">():</span> + <span class="n">sn2</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="n">k</span><span class="p">,</span> <span class="n">v</span><span class="p">)</span> +</pre></div> +</div> +<dl class="class"> +<dt id="singa.snapshot.Snapshot"> +<em class="property">class </em><code class="descclassname">singa.snapshot.</code><code class="descname">Snapshot</code><span class="sig-paren">(</span><em>f</em>, <em>mode</em>, <em>buffer_size=10</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.snapshot.Snapshot" title="Permalink to this definition">¶</a></dt> +<dd><p>Class and member functions for singa::Snapshot.</p> +<dl class="method"> +<dt id="singa.snapshot.Snapshot.read"> +<code class="descname">read</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#singa.snapshot.Snapshot.read" title="Permalink to this definition">¶</a></dt> +<dd><p>Call read method to load all (param_name, param_val)</p> +<dl class="field-list simple"> +<dt class="field-odd">Returns</dt> +<dd class="field-odd"><p>a dict of (parameter name, parameter Tensor)</p> +</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="singa.snapshot.Snapshot.write"> +<code class="descname">write</code><span class="sig-paren">(</span><em>param_name</em>, <em>param_val</em><span class="sig-paren">)</span><a class="headerlink" href="#singa.snapshot.Snapshot.write" title="Permalink to this definition">¶</a></dt> +<dd><p>Call Write method to write a parameter</p> +<dl class="field-list simple"> +<dt class="field-odd">Parameters</dt> +<dd class="field-odd"><ul class="simple"> +<li><p><strong>param_name</strong> (<em>string</em>) â name of the parameter</p></li> +<li><p><strong>param_val</strong> (<a class="reference internal" href="tensor.html#singa.tensor.Tensor" title="singa.tensor.Tensor"><em>Tensor</em></a>) â value tensor of the parameter</p></li> +</ul> +</dd> +</dl> +</dd></dl> + +</dd></dl> + +</div> + + + </div> + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="converter.html" class="btn btn-neutral float-right" title="Caffe Converter" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="image_tool.html" class="btn btn-neutral float-left" title="Image Tool" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019 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> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + + + + + + +<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> + <span class="rst-current-version" data-toggle="rst-current-version"> + <span class="fa fa-book"> incubator-singa </span> + v: latest + <span class="fa fa-caret-down"></span> + </span> + <div class="rst-other-versions"> + <dl> + <dt>Languages</dt> + <dd><a href="../../en/index.html">English</a></dd> + <dd><a href="../../zh/index.html">䏿</a></dd> + </dl> + <dl> + <dt>Versions</dt> + <dd><a href="http://singa.apache.org/v0.3.0/">0.3</a></dd> + <dd><a href="http://singa.apache.org/v1.1.0/">1.1</a></dd> + </dl> + + </div> + <a href="http://incubator.apache.org/"> <img src= "../_static/apache.png" style="background-color:white;"> </a> + + <a href="https://github.com/apache/incubator-singa" class="fa fa-github" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://aws.amazon.com/marketplace/seller-profile?id=5bcac385-12c4-4802-aec7-351e09b77b4c" class="fab fa-aws" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://hub.docker.com/r/apache/singa/" class="fab fa-docker" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.linkedin.com/groups/13550034" class="fa fa-linkedin" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://twitter.com/ApacheSinga" class="fa fa-twitter" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.facebook.com/Apache-SINGA-347284219056544/" class="fa fa-facebook" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.researchgate.net/project/Apache-SINGA" class="fab fa-researchgate" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + +</div> + + <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> + + + + +</body> +</html> \ No newline at end of file Added: incubator/singa/site/trunk/en/docs/software_stack.html URL: http://svn.apache.org/viewvc/incubator/singa/site/trunk/en/docs/software_stack.html?rev=1858059&view=auto ============================================================================== --- incubator/singa/site/trunk/en/docs/software_stack.html (added) +++ incubator/singa/site/trunk/en/docs/software_stack.html Wed Apr 24 14:57:35 2019 @@ -0,0 +1,406 @@ + + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Software Stack — incubator-singa 1.1.0 documentation</title> + + + + + + + + + <script type="text/javascript" src="../_static/js/modernizr.min.js"></script> + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + <link rel="next" title="Device" href="device.html" /> + <link rel="prev" title="Installation" href="installation.html" /> + <link href="../_static/style.css" rel="stylesheet" type="text/css"> + <!--link href="../_static/fontawesome-all.min.css" rel="stylesheet" type="text/css"--> + <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous"> + <style> + .fa:hover { + opacity: 0.7; + } + .fab:hover { + opacity: 0.7; + } + </style> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search" > + + + + <a href="../index.html" class="icon icon-home"> incubator-singa + + + + + <img src="../_static/singa.png" class="logo" alt="Logo"/> + + </a> + + + + + <div class="version"> + latest + </div> + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <ul class="current"> +<li class="toctree-l1 current"><a class="reference internal" href="index.html">Documentation</a><ul class="current"> +<li class="toctree-l2"><a class="reference internal" href="installation.html">Installation</a></li> +<li class="toctree-l2 current"><a class="current reference internal" href="#">Software Stack</a><ul> +<li class="toctree-l3"><a class="reference internal" href="#core">Core</a></li> +<li class="toctree-l3"><a class="reference internal" href="#model">Model</a></li> +<li class="toctree-l3"><a class="reference internal" href="#io">IO</a></li> +</ul> +</li> +<li class="toctree-l2"><a class="reference internal" href="device.html">Device</a></li> +<li class="toctree-l2"><a class="reference internal" href="tensor.html">Tensor</a></li> +<li class="toctree-l2"><a class="reference internal" href="layer.html">Layer</a></li> +<li class="toctree-l2"><a class="reference internal" href="net.html">FeedForward Net</a></li> +<li class="toctree-l2"><a class="reference internal" href="initializer.html">Initializer</a></li> +<li class="toctree-l2"><a class="reference internal" href="loss.html">Loss</a></li> +<li class="toctree-l2"><a class="reference internal" href="metric.html">Metric</a></li> +<li class="toctree-l2"><a class="reference internal" href="optimizer.html">Optimizer</a></li> +<li class="toctree-l2"><a class="reference internal" href="autograd.html">Autograd in Singa</a></li> +<li class="toctree-l2"><a class="reference internal" href="data.html">Data</a></li> +<li class="toctree-l2"><a class="reference internal" href="image_tool.html">Image Tool</a></li> +<li class="toctree-l2"><a class="reference internal" href="snapshot.html">Snapshot</a></li> +<li class="toctree-l2"><a class="reference internal" href="converter.html">Caffe Converter</a></li> +<li class="toctree-l2"><a class="reference internal" href="utils.html">Utils</a></li> +<li class="toctree-l2"><a class="reference internal" href="model_zoo/index.html">Model Zoo</a></li> +<li class="toctree-l2"><a class="reference internal" href="security.html">Security</a></li> +</ul> +</li> +<li class="toctree-l1"><a class="reference internal" href="../downloads.html">Download SINGA</a></li> +</ul> +<p class="caption"><span class="caption-text">Development</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../develop/schedule.html">Development Schedule</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html">How to Contribute to SINGA</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-contribute.html#how-to-become-a-singa-committer">How to become a SINGA committer</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-code.html">How to Contribute Code</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/contribute-docs.html">How to Contribute to Documentation</a></li> +<li class="toctree-l1"><a class="reference internal" href="../develop/how-to-release.html">How to prepare a release</a></li> +</ul> +<p class="caption"><span class="caption-text">Community</span></p> +<ul> +<li class="toctree-l1"><a class="reference internal" href="../community/source-repository.html">Source Repository</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/mail-lists.html">Project Mailing Lists</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/issue-tracking.html">Issue Tracking</a></li> +<li class="toctree-l1"><a class="reference internal" href="../community/team-list.html">The SINGA Team</a></li> +</ul> + + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">incubator-singa</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><a href="index.html">Documentation</a> »</li> + + <li>Software Stack</li> + + + <li class="wy-breadcrumbs-aside"> + + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. +--><div class="section" id="software-stack"> +<h1>Software Stack<a class="headerlink" href="#software-stack" title="Permalink to this headline">¶</a></h1> +<p>SINGAâs software stack includes three major components, namely, core, IO and +model. Figure 1 illustrates these components together with the hardware. +The core component provides memory management and tensor operations; +IO has classes for reading (and writing) data from (to) disk and network; The +model component provides data structures and algorithms for machine learning models, +e.g., layers for neural network models, optimizers/initializer/metric/loss for +general machine learning models.</p> +<img src="../_static/images/singav1-sw.png" align="center" width="500px"/> +<br/> +<span><strong>Figure 1 - SINGA V1 software stack.</strong></span><div class="section" id="core"> +<h2>Core<a class="headerlink" href="#core" title="Permalink to this headline">¶</a></h2> +<p><a class="reference external" href="tensor.html">Tensor</a> and <a class="reference external" href="device.html">Device</a> are two core abstractions in SINGA. Tensor class represents a +multi-dimensional array, which stores model variables and provides linear algebra +operations for machine learning +algorithms, including matrix multiplication and random functions. Each tensor +instance (i.e. a tensor) is allocated on a Device instance. +Each Device instance (i.e. a device) is created against one hardware device, +e.g. a GPU card or a CPU core. Devices manage the memory of tensors and execute +tensor operations on its execution units, e.g. CPU threads or CUDA streams.</p> +<p>Depending on the hardware and the programming language, SINGA have implemented +the following specific device classes:</p> +<ul class="simple"> +<li><p><strong>CudaGPU</strong> represents an Nvidia GPU card. The execution units are the CUDA streams.</p></li> +<li><p><strong>CppCPU</strong> represents a normal CPU. The execution units are the CPU threads.</p></li> +<li><p><strong>OpenclGPU</strong> represents normal GPU card from both Nvidia and AMD. +The execution units are the CommandQueues. Given that OpenCL is compatible with +many hardware devices, e.g. FPGA and ARM, the OpenclGPU has the potential to be +extended for other devices.</p></li> +</ul> +<p>Different types of devices use different programming languages to write the kernel +functions for tensor operations,</p> +<ul class="simple"> +<li><p>CppMath (tensor_math_cpp.h) implements the tensor operations using Cpp for CppCPU</p></li> +<li><p>CudaMath (tensor_math_cuda.h) implements the tensor operations using CUDA for CudaGPU</p></li> +<li><p>OpenclMath (tensor_math_opencl.h) implements the tensor operations using OpenCL for OpenclGPU</p></li> +</ul> +<p>In addition, different types of data, such as float32 and float16, could be supported by adding +the corresponding tensor functions.</p> +<p>Typically, users would create a device instance and pass it to create multiple +tensor instances. When users call the Tensor functions, these function would invoke +the corresponding implementation (CppMath/CudaMath/OpenclMath) automatically. In +other words, the implementation of Tensor operations is transparent to users.</p> +<p>Most machine learning algorithms could be expressed using (dense or sparse) tensors. +Therefore, with the Tensor abstraction, SINGA would be able to run a wide range of models, +including deep learning models and other traditional machine learning models.</p> +<p>The Tensor and Device abstractions are extensible to support a wide range of hardware device +using different programming languages. A new hardware device would be supported by +adding a new Device subclass and the corresponding implementation of the Tensor +operations (xxxMath).</p> +<p>Optimizations in terms of speed and memory could be implemented by Device, which +manages both operation execution and memory malloc/free. More optimization details +would be described in the <a class="reference external" href="device.html">Device page</a>.</p> +</div> +<div class="section" id="model"> +<h2>Model<a class="headerlink" href="#model" title="Permalink to this headline">¶</a></h2> +<p>On top of the Tensor and Device abstractions, SINGA provides some higher level +classes for machine learning modules.</p> +<ul class="simple"> +<li><p><a class="reference external" href="layer.html">Layer</a> and its subclasses are specific for neural networks. Every layer provides +functions for forward propagating features and backward propagating gradients w.r.t the training loss functions. +They wraps the complex layer operations so that users can easily create neural nets +by connecting a set of layers.</p></li> +<li><p><a class="reference external" href="initializer.html">Initializer</a> and its subclasses provide variant methods of initializing +model parameters (stored in Tensor instances), following Uniform, Gaussian, etc.</p></li> +<li><p><a class="reference external" href="loss.html">Loss</a> and its subclasses defines the training objective loss functions. +Both functions of computing the loss values and computing the gradient of the prediction w.r.t the +objective loss are implemented. Example loss functions include squared error and cross entropy.</p></li> +<li><p><a class="reference external" href="metric.html">Metric</a> and its subclasses provide the function to measure the +performance of the model, e.g., the accuracy.</p></li> +<li><p><a class="reference external" href="optimizer.html">Optimizer</a> and its subclasses implement the methods for updating +model parameter values using parameter gradients, including SGD, AdaGrad, RMSProp etc.</p></li> +</ul> +</div> +<div class="section" id="io"> +<h2>IO<a class="headerlink" href="#io" title="Permalink to this headline">¶</a></h2> +<p>The IO module consists of classes for data loading, data preprocessing and message passing.</p> +<ul class="simple"> +<li><p>Reader and its subclasses load string records from disk files</p></li> +<li><p>Writer and its subclasses write string records to disk files</p></li> +<li><p>Encoder and its subclasses encode Tensor instances into string records</p></li> +<li><p>Decoder and its subclasses decodes string records into Tensor instances</p></li> +<li><p>Endpoint represents a communication endpoint which provides functions for passing messages to each other.</p></li> +<li><p>Message represents communication messages between Endpoint instances. It carries both meta data and payload.</p></li> +</ul> +</div> +</div> + + + </div> + + </div> + <footer> + + <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> + + <a href="device.html" class="btn btn-neutral float-right" title="Device" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a> + + + <a href="installation.html" class="btn btn-neutral float-left" title="Installation" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> + + </div> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019 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> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + + + + + + +<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions"> + <span class="rst-current-version" data-toggle="rst-current-version"> + <span class="fa fa-book"> incubator-singa </span> + v: latest + <span class="fa fa-caret-down"></span> + </span> + <div class="rst-other-versions"> + <dl> + <dt>Languages</dt> + <dd><a href="../../en/index.html">English</a></dd> + <dd><a href="../../zh/index.html">䏿</a></dd> + </dl> + <dl> + <dt>Versions</dt> + <dd><a href="http://singa.apache.org/v0.3.0/">0.3</a></dd> + <dd><a href="http://singa.apache.org/v1.1.0/">1.1</a></dd> + </dl> + + </div> + <a href="http://incubator.apache.org/"> <img src= "../_static/apache.png" style="background-color:white;"> </a> + + <a href="https://github.com/apache/incubator-singa" class="fa fa-github" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://aws.amazon.com/marketplace/seller-profile?id=5bcac385-12c4-4802-aec7-351e09b77b4c" class="fab fa-aws" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://hub.docker.com/r/apache/singa/" class="fab fa-docker" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.linkedin.com/groups/13550034" class="fa fa-linkedin" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://twitter.com/ApacheSinga" class="fa fa-twitter" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.facebook.com/Apache-SINGA-347284219056544/" class="fa fa-facebook" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + <a href="https://www.researchgate.net/project/Apache-SINGA" class="fab fa-researchgate" style="padding: 10px; font-size: 20px; width: 30px; text-align: center; text-decoration: none; margin: 5px 2px;"></a> + +</div> + + <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> + + + + +</body> +</html> \ No newline at end of file
