gradientmachines.html 245.5 KB
Newer Older
Y
Yu Yang 已提交
1 2 3 4 5 6 7 8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
9
    <title>Gradient Machines &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    
    <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </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="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <link rel="top" title="PaddlePaddle  documentation" href="../../../index.html" />
    <link rel="up" title="Gradient Machines Documents" href="index.html" />
Y
Yu Yang 已提交
29
    <link rel="next" title="Matrix Documents" href="../../math/matrix/index.html" />
Y
Yu Yang 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42
    <link rel="prev" title="Gradient Machines Documents" href="index.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
Y
Yu Yang 已提交
43
          <a href="../../math/matrix/index.html" title="Matrix Documents"
Y
Yu Yang 已提交
44 45 46 47
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Gradient Machines Documents"
             accesskey="P">previous</a> |</li>
48 49 50
        <li class="nav-item nav-item-0"><a href="../../../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >Source Code Documents</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Gradient Machines Documents</a> &#187;</li> 
Y
Yu Yang 已提交
51 52 53 54 55 56 57 58 59
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="gradient-machines">
Y
Yu Yang 已提交
60 61 62
<h1>Gradient Machines<a class="headerlink" href="#gradient-machines" title="Permalink to this headline"></a></h1>
<div class="section" id="gradientmachine">
<h2>GradientMachine<a class="headerlink" href="#gradientmachine" title="Permalink to this headline"></a></h2>
Y
Yu Yang 已提交
63 64
<dl class="class">
<dt id="_CPPv2N6paddle15GradientMachineE">
Y
Yu Yang 已提交
65
<span id="paddle::GradientMachine"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">GradientMachine</code><a class="headerlink" href="#_CPPv2N6paddle15GradientMachineE" title="Permalink to this definition"></a></dt>
66
<dd><p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine"><span class="std std-ref">paddle::MultiGradientMachine</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork"><span class="std std-ref">paddle::NeuralNetwork</span></a></p>
Y
Yu Yang 已提交
67 68 69
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
Y
Yu Yang 已提交
70 71
<dt id="_CPPv2N6paddle15GradientMachine10CreateModeE">
<span id="paddle::GradientMachine::CreateMode"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a7c4414fbd8e4f20192b86a8e708781f8"></span><em class="property">enum </em><code class="descname">CreateMode</code><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine10CreateModeE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
72 73
<dd><p><em>Values:</em></p>
<dl class="member">
Y
Yu Yang 已提交
74 75
<dt id="_CPPv2N6paddle15GradientMachine7kNormalE">
<span id="paddle::GradientMachine::kNormal"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a7c4414fbd8e4f20192b86a8e708781f8afe924f9c48a2e9f6c1f4a57404afcce6"></span><code class="descname">kNormal</code> = 0<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine7kNormalE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
76 77 78
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
79 80
<dt id="_CPPv2N6paddle15GradientMachine21kSgdSparseCpuTrainingE">
<span id="paddle::GradientMachine::kSgdSparseCpuTraining"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a7c4414fbd8e4f20192b86a8e708781f8aa89fac2ba2d704015006b1dca0dc5be1"></span><code class="descname">kSgdSparseCpuTraining</code> = 3<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine21kSgdSparseCpuTrainingE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
81 82 83
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
84 85
<dt id="_CPPv2N6paddle15GradientMachine8kTestingE">
<span id="paddle::GradientMachine::kTesting"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a7c4414fbd8e4f20192b86a8e708781f8a4a84d035db265613e3bf50716ba6a70a"></span><code class="descname">kTesting</code> = 4<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine8kTestingE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
86 87 88
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
89 90
<dt id="_CPPv2N6paddle15GradientMachine7kCustomE">
<span id="paddle::GradientMachine::kCustom"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a7c4414fbd8e4f20192b86a8e708781f8abe968e18e03f6c07b661a5f8c2f750d9"></span><code class="descname">kCustom</code> = 10<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine7kCustomE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
<dd></dd></dl>

</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachineD0Ev">
<span id="paddle::GradientMachine::~GradientMachine"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a254dd3ee199825f6da6b217a74d657db"></span><code class="descname">~GradientMachine</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachineD0Ev" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine8prefetchERKNSt6vectorI8ArgumentEE">
<span id="paddle::GradientMachine::prefetch__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a38a3a738f64f69adb4a7ed23cf37db40"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine8prefetchERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
<dd><p>Prefetch row ids of sparse parameter. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType">
<span id="paddle::GradientMachine::forward__std::vector:Argument:CR.std::vector:Argument:P.PassType"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a60ae3a022a0faa5ff83bbb576402fdff"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType" title="Permalink to this definition"></a></dt>
<dd><p>Forward propagation. </p>
<p>Calculate outputs (outArgs) based the inputs (inArgs)</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
116
<dd>: if passType==PASS_TEST, then <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a5a6d89a9412849259e07729720c4b2cc"><span class="std std-ref">backward()</span></a> should not be called </dd>
Y
Yu Yang 已提交
117 118 119 120 121 122 123 124 125
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine8backwardERK14UpdateCallback">
<span id="paddle::GradientMachine::backward__UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a5a6d89a9412849259e07729720c4b2cc"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine8backwardERK14UpdateCallback" title="Permalink to this definition"></a></dt>
<dd><p>Backward propagation. </p>
<p>Calculate the gradient of inArgs and parameter.</p>
126 127
<p>This function should only be called after a corresponding <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a60ae3a022a0faa5ff83bbb576402fdff"><span class="std std-ref">forward()</span></a> call. The caller is responsible for filling the correct grad for the outArgs obtained using <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a60ae3a022a0faa5ff83bbb576402fdff"><span class="std std-ref">forward()</span></a>.</p>
<p>It may also change the grad field for the inArgs supplied at <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a60ae3a022a0faa5ff83bbb576402fdff"><span class="std std-ref">forward()</span></a> </p>
Y
Yu Yang 已提交
128 129 130 131 132
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback">
<span id="paddle::GradientMachine::forwardBackward__std::vector:Argument:CR.std::vector:Argument:P.PassType.UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a0fdab5811202bc5bf16ca58e2f14c994"></span>void <code class="descname">forwardBackward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback" title="Permalink to this definition"></a></dt>
133
<dd><p>Combine <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a60ae3a022a0faa5ff83bbb576402fdff"><span class="std std-ref">forward()</span></a> and <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a5a6d89a9412849259e07729720c4b2cc"><span class="std std-ref">backward()</span></a>. For multithread training, this may be faster.</p>
Y
Yu Yang 已提交
134 135
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
136
<dd>: passType PASS_TEST is not allowed for <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a0fdab5811202bc5bf16ca58e2f14c994"><span class="std std-ref">forwardBackward()</span></a>. </dd>
Y
Yu Yang 已提交
137 138 139 140 141 142 143 144 145 146 147
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine10resetStateEv">
<span id="paddle::GradientMachine::resetState"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a073ebcf6e78b1d23ac4bac8c94bb7f9e"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine10resetStateEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine8setStateERK12MachineState">
Y
Yu Yang 已提交
148
<span id="paddle::GradientMachine::setState__MachineStateCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a4687b4b0b112acca3be1328c94ec979c"></span>void <code class="descname">setState</code><span class="sig-paren">(</span><em class="property">const</em> MachineState &amp;<em>machineState</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine8setStateERK12MachineState" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
149 150 151 152
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine8getStateER12MachineState">
Y
Yu Yang 已提交
153
<span id="paddle::GradientMachine::getState__MachineStateR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a2d23d06d07d9d21148c11e53cf3f3b1d"></span>void <code class="descname">getState</code><span class="sig-paren">(</span>MachineState &amp;<em>machineState</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine8getStateER12MachineState" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
154 155 156 157 158 159 160 161 162
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine9onPassEndEv">
<span id="paddle::GradientMachine::onPassEnd"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a2b800d5801857d56d4b72c9aff267b89"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine9onPassEndEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine13makeEvaluatorEv">
Y
Yu Yang 已提交
163
<span id="paddle::GradientMachine::makeEvaluator"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a866512146d396e9da1c7dad4a5ee0b45"></span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<code class="descname">makeEvaluator</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine13makeEvaluatorEv" title="Permalink to this definition"></a></dt>
164
<dd><p>Create an evaluator which can be used for <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a2afd8662dead64471d904953af045af2"><span class="std std-ref">eval()</span></a> </p>
Y
Yu Yang 已提交
165 166 167 168
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine4evalEP9Evaluator">
Y
Yu Yang 已提交
169
<span id="paddle::GradientMachine::eval__EvaluatorP"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a2afd8662dead64471d904953af045af2"></span>void <code class="descname">eval</code><span class="sig-paren">(</span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<em>evaluator</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15GradientMachine4evalEP9Evaluator" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
<dd><p>evaluate using the given evaluator </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine13getParametersEv">
<span id="paddle::GradientMachine::getParameters"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a91dfc221139c3b41aacd829e6aa7ad3e"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; &amp;<code class="descname">getParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine13getParametersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine22getNonStaticParametersEv">
<span id="paddle::GradientMachine::getNonStaticParameters"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a33d6c10b56c75b10e4e838e5d8556e87"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; &amp;<code class="descname">getNonStaticParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine22getNonStaticParametersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine19hasStaticParametersEv">
<span id="paddle::GradientMachine::hasStaticParameters"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a1682b918fe059e1a2fa9c0ba21b9bf7e"></span>bool <code class="descname">hasStaticParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine19hasStaticParametersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine5startERK13TrainerConfig15DataProviderPtr">
Y
Yu Yang 已提交
190
<span id="paddle::GradientMachine::start__TrainerConfigCR.DataProviderPtr"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1aa360dcdb60f2276b8d8ccbc139183285"></span>void <code class="descname">start</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv213TrainerConfig" title="TrainerConfig">TrainerConfig</a> &amp;<em>config</em>, DataProviderPtr <em>dataProvider</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine5startERK13TrainerConfig15DataProviderPtr" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
<dd><p>Used before formal training, start work-threads and set trainer Parameters;. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This function will only been implemented and used in a multithreaded environment. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine6finishEv">
<span id="paddle::GradientMachine::finish"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a96d3bc3cb9f32f5fad548b89f62a034e"></span>void <code class="descname">finish</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine6finishEv" title="Permalink to this definition"></a></dt>
<dd><p>check each work-thread whether is failed/error/finish, if not, return ture, and yes return false. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This function will only been implemented and used in a multithreaded environment. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine9trainIsOnEv">
<span id="paddle::GradientMachine::trainIsOn"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a49b43e1c1ae50ccde652e0e93eda676a"></span>bool <code class="descname">trainIsOn</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine9trainIsOnEv" title="Permalink to this definition"></a></dt>
<dd><p>set the training status a &#8220;finished&#8221; value, the sub_work_threads will option the change, and then exit. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This function will only been implemented and used in a multithreaded environment. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine7restartEv">
<span id="paddle::GradientMachine::restart"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a23e55dcf118d92385711f6d051998f02"></span>void <code class="descname">restart</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine7restartEv" title="Permalink to this definition"></a></dt>
<dd><p>when all or some of the sub-workThreads are suspended to waiting controller&#8217;s instructions, and after some processing done in the controller, it will call this function to wake up all the pending thread. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This function will only been implemented and used in a multithreaded environment. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine13setOutputGradERKNSt6vectorI8ArgumentEE">
<span id="paddle::GradientMachine::setOutputGrad__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1a7281d8179e678a049b0fdbf518a46088"></span>void <code class="descname">setOutputGrad</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine13setOutputGradERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
235 236
<dd><p>Set the gradient of the output from outside. </p>
</dd></dl>
Y
Yu Yang 已提交
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263

<dl class="function">
<dt id="_CPPv2N15GradientMachine14saveParametersERKNSt6stringE">
<span id="GradientMachine::saveParameters__ssCR"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1abfde13f47024969ad402af82c855b77a"></span>void <code class="descname">saveParameters</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>dir</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N15GradientMachine14saveParametersERKNSt6stringE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N15GradientMachine14loadParametersERKNSt6stringE">
<span id="GradientMachine::loadParameters__ssCR"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a3927854cd54dbac8f54eade458b30307"></span>void <code class="descname">loadParameters</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>dir</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N15GradientMachine14loadParametersERKNSt6stringE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N15GradientMachine14randParametersEv">
<span id="GradientMachine::randParameters"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1af6aaa9545c90e648303288f24979eca1"></span>void <code class="descname">randParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N15GradientMachine14randParametersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine8getStatsER4realR7int64_t">
<span id="paddle::GradientMachine::getStats__realR.int64_tR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1acb0f5e410ffcacccea9f5b5266b5314c"></span>void <code class="descname">getStats</code><span class="sig-paren">(</span>real &amp;<em>cost</em>, int64_t &amp;<em>numProcessed</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine8getStatsER4realR7int64_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt>
<span class="target" id="paddleclasspaddle_1_1GradientMachine_1a499de31ce0a86d4fb2ba458bd67d830f"></span><code class="descname">GradientMachine * GradientMachine::create(const  ModelConfig  &amp; config, int mode = kNormal, const std::vector&lt; ParameterType &gt; &amp; parameterTypes = std::vector&lt; ParameterType &gt;{PARAMETER_VALUE, PARAMETER_GRADIENT, PARAMETER_MOMENTUM})</code></dt>
264
<dd><p>Create a gradient machine from <a class="reference internal" href="../../api/api.html#paddleclassModelConfig"><span class="std std-ref">ModelConfig</span></a> <a class="reference internal" href="../../parameter/parameter/parameter.html#paddleclasspaddle_1_1Parameter"><span class="std std-ref">Parameter</span></a> will have parameterTypes </p>
Y
Yu Yang 已提交
265 266 267 268
</dd></dl>

<dl class="function">
<dt id="_CPPv2N15GradientMachine6createERKNSt6stringEP10DataConfig">
269 270
<span id="GradientMachine::create__ssCR.DataConfigP"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1aa2e3f002654343886cdd17a00bf38c20"></span><a class="reference internal" href="../../api/api.html#_CPPv215GradientMachine" title="GradientMachine">GradientMachine</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>modelFile</em>, DataConfig *<em>dataConfig</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N15GradientMachine6createERKNSt6stringEP10DataConfig" title="Permalink to this definition"></a></dt>
<dd><p>Create a gradient machine from the merged model file. The merged model file can be generated using tools/merge_model If dataConfig is not null, it will be filled with the DataConfig from the <a class="reference internal" href="../../api/api.html#paddleclassTrainerConfig"><span class="std std-ref">TrainerConfig</span></a> </p>
Y
Yu Yang 已提交
271 272 273 274
</dd></dl>

<dl class="function">
<dt id="_CPPv2N15GradientMachine6createERNSt7istreamEP10DataConfig">
275 276
<span id="GradientMachine::create__isR.DataConfigP"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a6f80c53c1bfd2e9ec618db9a4032899d"></span><a class="reference internal" href="../../api/api.html#_CPPv215GradientMachine" title="GradientMachine">GradientMachine</a> *<code class="descname">create</code><span class="sig-paren">(</span>std::istream &amp;<em>is</em>, DataConfig *<em>dataConfig</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N15GradientMachine6createERNSt7istreamEP10DataConfig" title="Permalink to this definition"></a></dt>
<dd><p>Create a gradient machine from a stream which contains the merged model file. The merged model file can be generated using tools/merge_model If dataConfig is not null, it will be filled with the DataConfig from the <a class="reference internal" href="../../api/api.html#paddleclassTrainerConfig"><span class="std std-ref">TrainerConfig</span></a> </p>
Y
Yu Yang 已提交
277 278 279 280
</dd></dl>

<dl class="function">
<dt id="_CPPv2N15GradientMachine6createERKNSt6stringEP13TrainerConfig">
281 282
<span id="GradientMachine::create__ssCR.TrainerConfigP"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a9c26eb82df7a536af39b472af3b37754"></span><a class="reference internal" href="../../api/api.html#_CPPv215GradientMachine" title="GradientMachine">GradientMachine</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>modelFile</em>, <a class="reference internal" href="../../api/api.html#_CPPv213TrainerConfig" title="TrainerConfig">TrainerConfig</a> *<em>trainerConfig</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N15GradientMachine6createERKNSt6stringEP13TrainerConfig" title="Permalink to this definition"></a></dt>
<dd><p>Create a gradient machine from the merged model file. The merged model file can be generated using tools/merge_model If trainerConfig is not null, it will be filled with the <a class="reference internal" href="../../api/api.html#paddleclassTrainerConfig"><span class="std std-ref">TrainerConfig</span></a> </p>
Y
Yu Yang 已提交
283 284 285 286
</dd></dl>

<dl class="function">
<dt id="_CPPv2N15GradientMachine6createERNSt7istreamEP13TrainerConfig">
287 288
<span id="GradientMachine::create__isR.TrainerConfigP"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1a28ed48209b8c50eec089e83d2448c410"></span><a class="reference internal" href="../../api/api.html#_CPPv215GradientMachine" title="GradientMachine">GradientMachine</a> *<code class="descname">create</code><span class="sig-paren">(</span>std::istream &amp;<em>is</em>, <a class="reference internal" href="../../api/api.html#_CPPv213TrainerConfig" title="TrainerConfig">TrainerConfig</a> *<em>trainerConfig</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N15GradientMachine6createERNSt7istreamEP13TrainerConfig" title="Permalink to this definition"></a></dt>
<dd><p>Create a gradient machine from a stream which contains the merged model file. The merged model file can be generated using tools/merge_model If trainerConfig is not null, it will be filled with the <a class="reference internal" href="../../api/api.html#paddleclassTrainerConfig"><span class="std std-ref">TrainerConfig</span></a> </p>
Y
Yu Yang 已提交
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15GradientMachine15onLoadParameterEv">
<span id="paddle::GradientMachine::onLoadParameter"></span>virtual <span class="target" id="paddleclasspaddle_1_1GradientMachine_1aa6d686ed07dfaf308d1bf3138d6b2c7c"></span>void <code class="descname">onLoadParameter</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine15onLoadParameterEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle15GradientMachine11parameters_E">
<span id="paddle::GradientMachine::parameters___std::vector:ParameterPtr:"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1af25f5f4f2cd631e2ab59b1080e456176"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; <code class="descname">parameters_</code><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine11parameters_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GradientMachine20nonStaticParameters_E">
<span id="paddle::GradientMachine::nonStaticParameters___std::vector:ParameterPtr:"></span><span class="target" id="paddleclasspaddle_1_1GradientMachine_1ab59a21d39cf6bb34eb1a6ae7e0b1aaa0"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; <code class="descname">nonStaticParameters_</code><a class="headerlink" href="#_CPPv2N6paddle15GradientMachine20nonStaticParameters_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
315 316 317 318 319 320
</div>
<div class="section" id="gradientmachinemodel">
<h2>GradientMachineModel<a class="headerlink" href="#gradientmachinemodel" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle20IGradientMachineModeE">
<span id="paddle::IGradientMachineMode"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">IGradientMachineMode</code><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineModeE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
321
<dd><div class="breathe-sectiondef container">
Y
Yu Yang 已提交
322 323 324 325
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineModeD0Ev">
<span id="paddle::IGradientMachineMode::~IGradientMachineMode"></span>virtual <span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a5f981064b849cc62d62a2ab9c60c0928"></span><code class="descname">~IGradientMachineMode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineModeD0Ev" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
326 327
<dd></dd></dl>

Y
Yu Yang 已提交
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode6createERK11ModelConfig">
<span id="paddle::IGradientMachineMode::create__ModelConfigCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a93810a36c78ee43a5bf3b54975c55c93"></span><a class="reference internal" href="#_CPPv2N6paddle15GradientMachineE" title="paddle::GradientMachine">GradientMachine</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode6createERK11ModelConfig" title="Permalink to this definition"></a></dt>
<dd><p>create current mode&#8217;s gradient machine by model config. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">config</span></code> - <p>model config </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode10shouldBeMeERKNSt6stringE6size_tbb">
345 346
<span id="paddle::IGradientMachineMode::shouldBeMe__ssCR.s.b.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a322683640e99479bd94e54859f21d0b5"></span>bool <code class="descname">shouldBeMe</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>algo</em>, size_t <em>trainerCount</em>, bool <em>isLocal</em>, bool <em>isGpu</em><span class="sig-paren">)</span> const = 0<a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode10shouldBeMeERKNSt6stringE6size_tbb" title="Permalink to this definition"></a></dt>
<dd><p>shouldBeMe the current mode of <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine"><span class="std std-ref">GradientMachine</span></a> should be this mode. </p>
Y
Yu Yang 已提交
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>true if mode should be this mode. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">algo</span></code> - <p>training algorithm name. </p>
</li>
<li><code class="first docutils literal"><span class="pre">trainerCount</span></code> - <p>trainer count. </p>
</li>
<li><code class="first docutils literal"><span class="pre">isLocal</span></code> - <p>is local mode (without pserver) </p>
</li>
<li><code class="first docutils literal"><span class="pre">isGpu</span></code> - <p>is using gpu. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode15isDataMustInCpuE6size_t">
368
<span id="paddle::IGradientMachineMode::isDataMustInCpu__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a013545b056432104a068b7eec17edbad"></span>bool <code class="descname">isDataMustInCpu</code><span class="sig-paren">(</span>size_t <em>trainerCount</em><span class="sig-paren">)</span> const = 0<a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode15isDataMustInCpuE6size_t" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384
<dd><p>Is data must be in cpu even if using gpu mode. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>true if data must be gpu. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">trainerCount</span></code> - <p>trainer count </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode28needTrainWholeDataInOneBatchEv">
385
<span id="paddle::IGradientMachineMode::needTrainWholeDataInOneBatch"></span>virtual <span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a5936aa274940884dd6a9975d1893b110"></span>bool <code class="descname">needTrainWholeDataInOneBatch</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const = 0<a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode28needTrainWholeDataInOneBatchEv" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
386 387
<dd><p>Need not to use mini-batch method, and should train all data in one batch in one pass. </p>
</dd></dl>
Y
Yu Yang 已提交
388 389

</div>
Y
Yu Yang 已提交
390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode22regGradientMachineModeE7int32_tRRNSt10unique_ptrI20IGradientMachineModeEE">
<span id="paddle::IGradientMachineMode::regGradientMachineMode__int32_t.std::unique_ptr:IGradientMachineMode:RR"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a60289cbc8292213c3be599f35af2aebd"></span><em class="property">static</em> void <code class="descname">regGradientMachineMode</code><span class="sig-paren">(</span>int32_t <em>mode</em>, std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle20IGradientMachineModeE" title="paddle::IGradientMachineMode">IGradientMachineMode</a>&gt; &amp;&amp;<em>ptr</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode22regGradientMachineModeE7int32_tRRNSt10unique_ptrI20IGradientMachineModeEE" title="Permalink to this definition"></a></dt>
<dd><p>register a custom gradient machine mode. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>For user to register a custom gradient machine mode, id should &gt;= kCustom. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">mode</span></code> - <p>mode id. </p>
</li>
<li><code class="first docutils literal"><span class="pre">ptr</span></code> - <p>mode description object. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
410

Y
Yu Yang 已提交
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode4modeE7int32_t">
<span id="paddle::IGradientMachineMode::mode__int32_t"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a9cbba4e20b0c216cfbb59e280d0405e4"></span><em class="property">static</em> <a class="reference internal" href="#_CPPv2N6paddle20IGradientMachineModeE" title="paddle::IGradientMachineMode">IGradientMachineMode</a> *<code class="descname">mode</code><span class="sig-paren">(</span>int32_t <em>mode</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode4modeE7int32_t" title="Permalink to this definition"></a></dt>
<dd><p>get custom mode from mode id. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>mode description object. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">mode</span></code> - <p>mode id </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
427

Y
Yu Yang 已提交
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode24trainWholeDataInOneBatchE7int32_t">
<span id="paddle::IGradientMachineMode::trainWholeDataInOneBatch__int32_t"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1af41c9ab4a64987ba9fdefab168b704e5"></span><em class="property">static</em> bool <code class="descname">trainWholeDataInOneBatch</code><span class="sig-paren">(</span>int32_t <em>mode</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode24trainWholeDataInOneBatchE7int32_t" title="Permalink to this definition"></a></dt>
<dd><p>helper function to test trainWholeDataInOneBatch or not for mode </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode10tryGetModeEPiRKNSt6stringE7int32_tbb">
<span id="paddle::IGradientMachineMode::tryGetMode__iP.ssCR.int32_t.b.b"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a80e4766f7faceac54fedb0971bacb2e7"></span><em class="property">static</em> bool <code class="descname">tryGetMode</code><span class="sig-paren">(</span>int *<em>mode</em>, <em class="property">const</em> std::string &amp;<em>algo</em>, int32_t <em>trainerCount</em>, bool <em>isLocal</em>, bool <em>isGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode10tryGetModeEPiRKNSt6stringE7int32_tbb" title="Permalink to this definition"></a></dt>
<dd><p>Try to get custom mode if we can. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>true if there is a custom mode fit these conditions. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">mode</span></code> - <p>the custom mode id. </p>
</li>
<li><code class="first docutils literal"><span class="pre">algo</span></code> - <p>algorithm name </p>
</li>
<li><code class="first docutils literal"><span class="pre">trainerCount</span></code> - <p>trainer count. </p>
</li>
<li><code class="first docutils literal"><span class="pre">isLocal</span></code> - <p>is local or not </p>
</li>
<li><code class="first docutils literal"><span class="pre">isGpu</span></code> - <p>using gpu or not. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode13dataMustInCpuE7int32_t6size_t">
<span id="paddle::IGradientMachineMode::dataMustInCpu__int32_t.s"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a7fbe12455d11ef94af3fbd094754bf34"></span><em class="property">static</em> bool <code class="descname">dataMustInCpu</code><span class="sig-paren">(</span>int32_t <em>mode</em>, size_t <em>trainerCount</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode13dataMustInCpuE7int32_t6size_t" title="Permalink to this definition"></a></dt>
<dd><p>helper function for data must in cpu </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20IGradientMachineMode24tryCreateGradientMachineE7int32_tRK11ModelConfig">
<span id="paddle::IGradientMachineMode::tryCreateGradientMachine__int32_t.ModelConfigCR"></span><span class="target" id="paddleclasspaddle_1_1IGradientMachineMode_1a4a237293d931b302a31ff48d8ec1c556"></span><em class="property">static</em> <a class="reference internal" href="#_CPPv2N6paddle15GradientMachineE" title="paddle::GradientMachine">GradientMachine</a> *<code class="descname">tryCreateGradientMachine</code><span class="sig-paren">(</span>int32_t <em>mode</em>, <em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20IGradientMachineMode24tryCreateGradientMachineE7int32_tRK11ModelConfig" title="Permalink to this definition"></a></dt>
<dd><p>try to create gradient machine by mode &amp; config. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>nullptr if we cannot create a gradient machine by such mode. </dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
475 476 477 478

</div>
</dd></dl>

Y
Yu Yang 已提交
479 480 481
</div>
<div class="section" id="multigradientmachine">
<h2>MultiGradientMachine<a class="headerlink" href="#multigradientmachine" title="Permalink to this headline"></a></h2>
Y
Yu Yang 已提交
482 483
<dl class="class">
<dt id="_CPPv2N6paddle20MultiGradientMachineE">
Y
Yu Yang 已提交
484
<span id="paddle::MultiGradientMachine"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MultiGradientMachine</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachineE" title="Permalink to this definition"></a></dt>
485
<dd><p>A <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine"><span class="std std-ref">MultiGradientMachine</span></a> is a synchronous <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine"><span class="std std-ref">GradientMachine</span></a> which devides one data batch into several smaller batches and assign each one small batch to one computint thread for computation. After each thread finishes computation, it merges result (including output <a class="reference internal" href="../../parameter/parameter/parameter.html#paddlestructpaddle_1_1Argument"><span class="std std-ref">Argument</span></a> and gradient during <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a>). It basically is the same as single thread gradient machine, except that it uses multi-thread to do the computation.</p>
Y
Yu Yang 已提交
486 487
<p>It handles GPU and Cpu parameters differently. In GPU, one computing thread generally corresponds to one GPU device. Thus, each thread keeps a separate copy of the parameter in its own device&#8217;s memory. In CPU, we only need to keep one copy of the parameters in the main memory. After, each computing thread computes its own parameter gradient, the update process needs to accumulate the parameter gradients from all the computing threads, and update the accumulated parameter gradient to the corresponding parameter value.</p>
<p>Each GPU parameter is assigned to a thread called its main thread. For each parameter, the accumulation of its gradients and the update of its value happens in its main thread. The main thread first gather the parameter gradients from all the computing thread. Then, it performs parameter update. After a gradient is updated by the main thread, it is scattered to all the computing thread so that the parameters in all the computing threads are synchronized. The scatter and gather process are implemented by ring-style communication. Assume we have N computing threads, its thread ids will be 0, 1, ..., N-1. For each parameter, the id of the main thread is specified in paraMainThread_[pid], where pid is the id of the parameter. Each thread i only sends data to its partner thread (i - 1) % N. For example, for a parameter gradient that is computed in thread 4, and its main thread is 2. Its traveling process would be 4, 5,..., N-1, 0, 1, 2. In each step, the gradient buffer is added to the local gradient, and the local gradient is then copied to the gradient buffer of the next thread. At last, its main thread 2 will get the accumulated parameter gradient. For the same parameter, after its value is updated, the value&#8217;s traveling process would be 2, 1, 0, N-1, ... 3. At the end, all the computing threads would have the updated parameter value.</p>
488
<p>A computing thread (<a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a>) uses 4 threads to do different jobs:</p>
Y
Yu Yang 已提交
489
<p><ol class="arabic simple">
490
<li>computeThread(): performing <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"><span class="std std-ref">forward()</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a7ff6e80ce978e95e0f5736c343d69270"><span class="std std-ref">prefetch()</span></a>.</li>
Y
Yu Yang 已提交
491 492 493 494 495
<li>valueDispatchThread(): copying parameter values to partner thread.</li>
<li>copyGradToBufferThread(): copying parameter gradient to partner thread.</li>
<li>gradCollectThread(): merging the gradient from step 3 with local gradient and call the callback supplied by the user to update parameter value.</li>
</ol>
</p>
496
<p>CPU parameter value has only one copy. And their gradients are merged at the end of <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a>.</p>
Y
Yu Yang 已提交
497 498 499 500 501 502 503 504 505 506
<p><ul class="simple">
<li>Handling of sparse update Currently, sparse update is only supported for CPU parameters.</li>
</ul>
</p>
<p>Sparse updates refers to gradient caculation where the gradient is sparse. For example, if the input argument to a &#8216;fc&#8217; layer is sparse, the gradient of the weight matrix of this layer will be sparse. It is usually more efficient to treat the gradient explicitly as sparse vector during the parameter update.</p>
<p>There are two types of sparse updates called local sparse update and remote sparse update.</p>
<p>For both types of sparse updates, there is one copy of parameter value and gradient called main parameter value and gradient, and there is a copy of parameter value and gradient for each computing thread called slave parameter value and gradient. The slave parameter values are always shared with the corresponding main parameter value. The slave parameter grad is a sparse row matrix. The sparse pattern for slave parameter grads are different, because the small batches for each computing thread might have different sparsity pattern.</p>
<p><ol class="arabic">
<li><p class="first">Local sparse update</p>
<p>Main parameter value type is MAT_NORMAL. It is a dense matrix.</p>
507
<p>Main parameter grad type is MAT_SPARSE_ROW_IDS (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseRowIdsCpuMatrix"><span class="std std-ref">SparseRowIdsCpuMatrix</span></a>) It is also a dense matrix, but the updated values are specified by IDS.</p>
Y
Yu Yang 已提交
508
<p>Slave parameter value shares with main parameter value.</p>
509 510
<p>Slave parameter grad type is MAT_SPARSE_ROW_AUTO_GROW (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix"><span class="std std-ref">SparseAutoGrowRowCpuMatrix</span></a>). It is a sparse row matrix.</p>
<p>During <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a> of each <a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a>, <a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix"><span class="std std-ref">SparseAutoGrowRowCpuMatrix</span></a> will gather all the non-zero gradient. And After <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a>, they will be merged into main parameter grad (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseRowIdsCpuMatrix"><span class="std std-ref">SparseRowIdsCpuMatrix</span></a>), with indices indicating which rows have nonzero gradient.</p>
Y
Yu Yang 已提交
511 512
</li>
<li><p class="first">Remote sparse update</p>
513 514 515 516 517
<p>Main parameter value type is MAT_SPARSE_ROW_PREFETCH(_FULL_SIZE) (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix"><span class="std std-ref">SparsePrefetchRowCpuMatrix</span></a>). MAT_SPARSE_ROW_PREFETCH is a sparse matrix. MAT_SPARSE_ROW_PREFETCH_FULL_SIZE is a dense matrix. However, only the parameter values that are prefetched is up-to-date.</p>
<p>Main parameter grad type is MAT_SPARSE_ROW (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">SparseRowCpuMatrix</span></a>). And it shares sparse pattern with value by sharing indexDictHandle_, which is an internal data structure used by SparseRowCpuMatrixto specify the sparsity pattern of Slave parameter value shares with main parameter value.</p>
<p>Slave parameter grad type is MAT_SPARSE_ROW_AUTO_GROW (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix"><span class="std std-ref">SparsePrefetchRowCpuMatrix</span></a>). It is a sparse row matrix</p>
<p>During <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a7ff6e80ce978e95e0f5736c343d69270"><span class="std std-ref">prefetch()</span></a>, all the layers will indicates which rows of each parameter are needed. Then the framework will retrieve those rows from parameter server.</p>
<p>During <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a> of each <a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a>, <a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix"><span class="std std-ref">SparseAutoGrowRowCpuMatrix</span></a> will gather all the non-zero gradient. And After <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a>, they will be merged into main parameter grad (<a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">SparseRowCpuMatrix</span></a>). And the framework will send the merged gradient to parameter server. </p>
Y
Yu Yang 已提交
518 519 520
</li>
</ol>
</p>
521
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine"><span class="std std-ref">paddle::GradientMachine</span></a></p>
Y
Yu Yang 已提交
522 523 524
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
Y
Yu Yang 已提交
525 526
<dt id="_CPPv2N6paddle20MultiGradientMachine8TaskTypeE">
<span id="paddle::MultiGradientMachine::TaskType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab329039c9110a9413748b9c69db33e1a"></span><em class="property">enum </em><code class="descname">TaskType</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine8TaskTypeE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
527 528
<dd><p><em>Values:</em></p>
<dl class="member">
Y
Yu Yang 已提交
529 530
<dt id="_CPPv2N6paddle20MultiGradientMachine21TASK_FORWARD_BACKWARDE">
<span id="paddle::MultiGradientMachine::TASK_FORWARD_BACKWARD"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab329039c9110a9413748b9c69db33e1aadada6d20f165e0debe1b145390ee46d7"></span><code class="descname">TASK_FORWARD_BACKWARD</code> = 0<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine21TASK_FORWARD_BACKWARDE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
531 532 533
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
534 535
<dt id="_CPPv2N6paddle20MultiGradientMachine12TASK_FORWARDE">
<span id="paddle::MultiGradientMachine::TASK_FORWARD"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab329039c9110a9413748b9c69db33e1aa190bccd5670a9aba70b418e9387feff0"></span><code class="descname">TASK_FORWARD</code> = 1<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine12TASK_FORWARDE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
536 537 538
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
539 540
<dt id="_CPPv2N6paddle20MultiGradientMachine13TASK_BACKWARDE">
<span id="paddle::MultiGradientMachine::TASK_BACKWARD"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab329039c9110a9413748b9c69db33e1aae3d00a4afd8abd2051937d44a7b7779b"></span><code class="descname">TASK_BACKWARD</code> = 2<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13TASK_BACKWARDE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
541 542 543
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
544 545
<dt id="_CPPv2N6paddle20MultiGradientMachine17TASK_COPY_IN_ARGSE">
<span id="paddle::MultiGradientMachine::TASK_COPY_IN_ARGS"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab329039c9110a9413748b9c69db33e1aa31a90f80f75b8d7e6645e3b1149890e6"></span><code class="descname">TASK_COPY_IN_ARGS</code> = 3<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine17TASK_COPY_IN_ARGSE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570
<dd></dd></dl>

</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine20MultiGradientMachineERK11ModelConfigb">
<span id="paddle::MultiGradientMachine::MultiGradientMachine__ModelConfigCR.b"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1afcc3e086fbf742fd9373b2154d8e3038"></span><code class="descname">MultiGradientMachine</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine20MultiGradientMachineERK11ModelConfigb" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine8prefetchERKNSt6vectorI8ArgumentEE">
<span id="paddle::MultiGradientMachine::prefetch__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a7ff6e80ce978e95e0f5736c343d69270"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine8prefetchERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
<dd><p>Prefetch row ids of sparse parameter. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType">
<span id="paddle::MultiGradientMachine::forward__std::vector:Argument:CR.std::vector:Argument:P.PassType"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType" title="Permalink to this definition"></a></dt>
<dd><p>Forward propagation. </p>
<p>Calculate outputs (outArgs) based the inputs (inArgs)</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
571
<dd>: if passType==PASS_TEST, then <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a> should not be called </dd>
Y
Yu Yang 已提交
572 573 574 575 576 577 578 579 580
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine8backwardERK14UpdateCallback">
<span id="paddle::MultiGradientMachine::backward__UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine8backwardERK14UpdateCallback" title="Permalink to this definition"></a></dt>
<dd><p>Backward propagation. </p>
<p>Calculate the gradient of inArgs and parameter.</p>
581 582
<p>This function should only be called after a corresponding <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"><span class="std std-ref">forward()</span></a> call. The caller is responsible for filling the correct grad for the outArgs obtained using <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"><span class="std std-ref">forward()</span></a>.</p>
<p>It may also change the grad field for the inArgs supplied at <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"><span class="std std-ref">forward()</span></a> </p>
Y
Yu Yang 已提交
583 584 585 586 587
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback">
<span id="paddle::MultiGradientMachine::forwardBackward__std::vector:Argument:CR.std::vector:Argument:P.PassType.UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ac945ff36e0e3817613daf6978836ab83"></span>void <code class="descname">forwardBackward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback" title="Permalink to this definition"></a></dt>
588
<dd><p>Combine <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"><span class="std std-ref">forward()</span></a> and <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1acbe5222c8b2b4468e7f39ea598b09bec"><span class="std std-ref">backward()</span></a>. For multithread training, this may be faster.</p>
Y
Yu Yang 已提交
589 590
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
591
<dd>: passType PASS_TEST is not allowed for <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1ac945ff36e0e3817613daf6978836ab83"><span class="std std-ref">forwardBackward()</span></a>. </dd>
Y
Yu Yang 已提交
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine9onPassEndEv">
<span id="paddle::MultiGradientMachine::onPassEnd"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a81852a09b359652615234d1788946039"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9onPassEndEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine6finishEv">
<span id="paddle::MultiGradientMachine::finish"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a6b01b236413a146bd8ff381a48cba875"></span>void <code class="descname">finish</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine6finishEv" title="Permalink to this definition"></a></dt>
<dd><p>check each work-thread whether is failed/error/finish, if not, return ture, and yes return false. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This function will only been implemented and used in a multithreaded environment. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine13makeEvaluatorEv">
Y
Yu Yang 已提交
614
<span id="paddle::MultiGradientMachine::makeEvaluator"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a814661776f9b7b5c8e6c040ce1faa2ec"></span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<code class="descname">makeEvaluator</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13makeEvaluatorEv" title="Permalink to this definition"></a></dt>
615
<dd><p>Create an evaluator which can be used for <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a956574785e025b33bdf9540f5f2607c0"><span class="std std-ref">eval()</span></a> </p>
Y
Yu Yang 已提交
616 617 618 619
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine4evalEP9Evaluator">
Y
Yu Yang 已提交
620
<span id="paddle::MultiGradientMachine::eval__EvaluatorP"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a956574785e025b33bdf9540f5f2607c0"></span>void <code class="descname">eval</code><span class="sig-paren">(</span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<em>evaluator</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine4evalEP9Evaluator" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
621 622 623 624 625 626 627 628 629 630 631
<dd><p>evaluate using the given evaluator </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine6useGpuEv">
<span id="paddle::MultiGradientMachine::useGpu"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aaac5adc4bf77fdb8ef23b231d4724bc2"></span>bool <code class="descname">useGpu</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine6useGpuEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine10isPassGradEv">
<span id="paddle::MultiGradientMachine::isPassGrad"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a5404ae5199a1af02593d85a7ac187214"></span>bool <code class="descname">isPassGrad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine10isPassGradEv" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
632 633 634 635 636 637
<dd><p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>whether to pass the gradients in outArgs_ to each threads. </dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
638 639 640 641

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine11setPassGradEb">
<span id="paddle::MultiGradientMachine::setPassGrad__b"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a24b2a4beee6e6b2a20488d0d5b805361"></span>void <code class="descname">setPassGrad</code><span class="sig-paren">(</span>bool <em>isPass</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11setPassGradEb" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
642 643
<dd><p>set whether to pass the gradient in outArgs_ to each threads. </p>
</dd></dl>
Y
Yu Yang 已提交
644 645 646 647

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine13setOutputGradERKNSt6vectorI8ArgumentEE">
<span id="paddle::MultiGradientMachine::setOutputGrad__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1afe32701c77c2f9ff307edee064078384"></span>void <code class="descname">setOutputGrad</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13setOutputGradERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
648 649
<dd><p>Set the gradients of the outputs. The gradietns will be copied to each thread in the computing threads. </p>
</dd></dl>
Y
Yu Yang 已提交
650 651 652 653 654 655

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine13getAllThreadsEv">
Y
Yu Yang 已提交
656
<span id="paddle::MultiGradientMachine::getAllThreads"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a6e6eaee1aaabae5d9e05ffca437339ff"></span>std::vector&lt;TrainerThreadPtr&gt; &amp;<code class="descname">getAllThreads</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13getAllThreadsEv" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
657 658 659 660 661
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine28logicalDeviceId2RealDeviceIdEii">
<span id="paddle::MultiGradientMachine::logicalDeviceId2RealDeviceId__i.i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a62718b7ed281236b2dca224170bcb473"></span>int <code class="descname">logicalDeviceId2RealDeviceId</code><span class="sig-paren">(</span>int <em>logicalId</em>, int <em>threadId</em> = 0<span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine28logicalDeviceId2RealDeviceIdEii" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
662 663
<dd><p>Calculate the real device id based on the logical device id and the thread id. </p>
</dd></dl>
Y
Yu Yang 已提交
664 665 666 667

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine28realDeviceId2LogicalDeviceIdEii">
<span id="paddle::MultiGradientMachine::realDeviceId2LogicalDeviceId__i.i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aa3738d3ed4b4c09fa228befa472afcac"></span>int <code class="descname">realDeviceId2LogicalDeviceId</code><span class="sig-paren">(</span>int <em>realId</em>, int <em>threadId</em> = 0<span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine28realDeviceId2LogicalDeviceIdEii" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
668 669
<dd><p>Calculate the logical device id based on the real device id and the thread id. </p>
</dd></dl>
Y
Yu Yang 已提交
670 671 672 673 674 675 676 677 678 679 680 681 682 683

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine18getSlaveParametersEv">
<span id="paddle::MultiGradientMachine::getSlaveParameters"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a81e24b61e9d847782f8ab730d1798b49"></span>std::vector&lt;<em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; *&gt; <code class="descname">getSlaveParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine18getSlaveParametersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine24hasNonstaticCpuParamtersEv">
<span id="paddle::MultiGradientMachine::hasNonstaticCpuParamters"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a8000a40fd33243e53af0aafad2796929"></span>bool <code class="descname">hasNonstaticCpuParamters</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine24hasNonstaticCpuParamtersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine15waitBeforeMergeEv">
<span id="paddle::MultiGradientMachine::waitBeforeMerge"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aa25270c11c077dc61c5799304f1ba98a"></span>void <code class="descname">waitBeforeMerge</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine15waitBeforeMergeEv" title="Permalink to this definition"></a></dt>
684
<dd><p>Called <a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a> to wait before merging CPU parameter gradients. </p>
Y
Yu Yang 已提交
685
</dd></dl>
Y
Yu Yang 已提交
686 687 688 689

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine14waitAfterMergeEv">
<span id="paddle::MultiGradientMachine::waitAfterMerge"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aff48c3ae2c7239f285375c50c5b066c9"></span>void <code class="descname">waitAfterMerge</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine14waitAfterMergeEv" title="Permalink to this definition"></a></dt>
690
<dd><p>called by <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine"><span class="std std-ref">MultiGradientMachine</span></a> and <a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a> to wait after merging CPU parameter graidents. </p>
Y
Yu Yang 已提交
691
</dd></dl>
Y
Yu Yang 已提交
692 693 694 695

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine17waitForCopyInArgsEv">
<span id="paddle::MultiGradientMachine::waitForCopyInArgs"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a928abc9a1a14a8be3adeb233fe0ce60a"></span>void <code class="descname">waitForCopyInArgs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine17waitForCopyInArgsEv" title="Permalink to this definition"></a></dt>
696
<dd><p>called by <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine"><span class="std std-ref">MultiGradientMachine</span></a> and <a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a> to wait for copyInArgs() finishing </p>
Y
Yu Yang 已提交
697
</dd></dl>
Y
Yu Yang 已提交
698 699 700

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine9getThreadEi">
Y
Yu Yang 已提交
701
<span id="paddle::MultiGradientMachine::getThread__i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a72596aff38106aeee711c0bf61bc6d3f"></span>TrainerThreadPtr &amp;<code class="descname">getThread</code><span class="sig-paren">(</span>int <em>threadId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9getThreadEi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
702 703 704 705
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine10getGradBufEi">
Y
Yu Yang 已提交
706
<span id="paddle::MultiGradientMachine::getGradBuf__i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aa2f641fdc127b24f143d6372893d139c"></span>std::vector&lt;GradBuffer&gt; &amp;<code class="descname">getGradBuf</code><span class="sig-paren">(</span>int <em>threadId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine10getGradBufEi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
707 708 709 710 711 712 713 714 715 716
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine11getPassTypeEv">
<span id="paddle::MultiGradientMachine::getPassType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a97b4037b8ccac99e0c82bcdda2749f16"></span>PassType <code class="descname">getPassType</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11getPassTypeEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine22notifyGradientTransferEi">
<span id="paddle::MultiGradientMachine::notifyGradientTransfer__i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1adb14f03f60337cf15a674db0d2977910"></span>void <code class="descname">notifyGradientTransfer</code><span class="sig-paren">(</span>int <em>paramId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine22notifyGradientTransferEi" title="Permalink to this definition"></a></dt>
717
<dd><p>Called by <a class="reference internal" href="#paddleclasspaddle_1_1TrainerThread"><span class="std std-ref">TrainerThread</span></a> to notify <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine"><span class="std std-ref">MultiGradientMachine</span></a> that the gradient for paramId is ready </p>
Y
Yu Yang 已提交
718
</dd></dl>
Y
Yu Yang 已提交
719 720 721 722 723 724 725 726

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine9getInArgsEv">
<span id="paddle::MultiGradientMachine::getInArgs"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a7a60e3ded062244962827ba4cd4b54d5"></span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<code class="descname">getInArgs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9getInArgsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine11getTaskTypeEv">
Y
Yu Yang 已提交
727
<span id="paddle::MultiGradientMachine::getTaskType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a3b1d117b8c0ac4c25e378baa6c8ef071"></span><a class="reference internal" href="#_CPPv2N6paddle20MultiGradientMachine8TaskTypeE" title="paddle::MultiGradientMachine::TaskType">TaskType</a> <code class="descname">getTaskType</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11getTaskTypeEv" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine19getBackwardCallbackEv">
<span id="paddle::MultiGradientMachine::getBackwardCallback"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a7d55960ef7c7bb7d8f272a1014af38ec"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<code class="descname">getBackwardCallback</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine19getBackwardCallbackEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine13getNumDevicesEv">
<span id="paddle::MultiGradientMachine::getNumDevices"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a334571ce7890d771935a7f32e746bc79"></span>int <code class="descname">getNumDevices</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13getNumDevicesEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine20getNumLogicalDevicesEv">
<span id="paddle::MultiGradientMachine::getNumLogicalDevices"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ac559ec03dd0f88e2cbe5e896a84c302f"></span>int <code class="descname">getNumLogicalDevices</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine20getNumLogicalDevicesEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine13getNumThreadsEv">
<span id="paddle::MultiGradientMachine::getNumThreads"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a53ddc9bd1ec8711793c287a8c3a749cd"></span>int <code class="descname">getNumThreads</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13getNumThreadsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine14paraMainThreadEi">
<span id="paddle::MultiGradientMachine::paraMainThread__i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a13c05598859b23c2efc4a72f95afc222"></span>int <code class="descname">paraMainThread</code><span class="sig-paren">(</span>int <em>pid</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine14paraMainThreadEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine10forwardImpERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType8TaskType">
Y
Yu Yang 已提交
757
<span id="paddle::MultiGradientMachine::forwardImp__std::vector:Argument:CR.std::vector:Argument:P.PassType.TaskType"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a962a71b24fe4646d90b4212fe30c0d56"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em>, <a class="reference internal" href="#_CPPv2N6paddle20MultiGradientMachine8TaskTypeE" title="paddle::MultiGradientMachine::TaskType">TaskType</a> <em>taskType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine10forwardImpERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType8TaskType" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
758 759 760 761 762 763 764 765 766 767
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine11backwardImpERK14UpdateCallback">
<span id="paddle::MultiGradientMachine::backwardImp__UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a0a74df6afca5992f835efc217c12476f"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = NULL<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11backwardImpERK14UpdateCallback" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine22updateThreadParametersEv">
<span id="paddle::MultiGradientMachine::updateThreadParameters"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aa42ce76cea102cd63ff66d67cc26d27e"></span>void <code class="descname">updateThreadParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine22updateThreadParametersEv" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
768 769
<dd><p>update all parameters </p>
</dd></dl>
Y
Yu Yang 已提交
770 771 772

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine9startTaskE8TaskType">
Y
Yu Yang 已提交
773
<span id="paddle::MultiGradientMachine::startTask__TaskType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a5df310f4d2907b7ab6e9938e25db201f"></span>void <code class="descname">startTask</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle20MultiGradientMachine8TaskTypeE" title="paddle::MultiGradientMachine::TaskType">TaskType</a> <em>taskType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9startTaskE8TaskType" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine10getOutArgsEPNSt6vectorI8ArgumentEE8PassType">
<span id="paddle::MultiGradientMachine::getOutArgs__std::vector:Argument:P.PassType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a6a2fc155b59d691f6ff4c185cc7398ef"></span>void <code class="descname">getOutArgs</code><span class="sig-paren">(</span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine10getOutArgsEPNSt6vectorI8ArgumentEE8PassType" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20MultiGradientMachine13allocGradBufsEv">
<span id="paddle::MultiGradientMachine::allocGradBufs"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1abc5086aea06f3a8bd9c09413de09aa5c"></span>void <code class="descname">allocGradBufs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13allocGradBufsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine7useGpu_E">
<span id="paddle::MultiGradientMachine::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a18bd6d01284e8f57202a0c641ac2d395"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine7useGpu_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine25hasNonstaticCpuParamters_E">
<span id="paddle::MultiGradientMachine::hasNonstaticCpuParamters___b"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ac7478a9d28d026554b34171fbfa75a67"></span>bool <code class="descname">hasNonstaticCpuParamters_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine25hasNonstaticCpuParamters_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine16gradientMachine_E">
<span id="paddle::MultiGradientMachine::gradientMachine___std::unique_ptr:GradientMachine:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a41d39fa876fc4b3fb48ab7b8e7abf5eb"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15GradientMachineE" title="paddle::GradientMachine">GradientMachine</a>&gt; <code class="descname">gradientMachine_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine16gradientMachine_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
802 803
<dd><p>store main parameter only </p>
</dd></dl>
Y
Yu Yang 已提交
804 805 806

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine8threads_E">
Y
Yu Yang 已提交
807
<span id="paddle::MultiGradientMachine::threads___std::vector:TrainerThreadPtr:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ad7ac4a5ca60cde2171296113d8dc9bb3"></span>std::vector&lt;TrainerThreadPtr&gt; <code class="descname">threads_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine8threads_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
808 809 810 811 812 813 814 815 816
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine15paraMainThread_E">
<span id="paddle::MultiGradientMachine::paraMainThread___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ae924fb781bb4ce01ac6cf599c1406f28"></span>std::vector&lt;int&gt; <code class="descname">paraMainThread_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine15paraMainThread_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine9gradBufs_E">
Y
Yu Yang 已提交
817
<span id="paddle::MultiGradientMachine::gradBufs___std::vector:std::vector:GradBuffer::"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a340dbb2788a2d72927808091dbd5cc86"></span>std::vector&lt;std::vector&lt;GradBuffer&gt;&gt; <code class="descname">gradBufs_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9gradBufs_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
818 819 820 821 822 823 824 825 826 827 828 829 830 831
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine12bufferSizes_E">
<span id="paddle::MultiGradientMachine::bufferSizes___std::vector:s:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a834152e1763c44b6f75610e03ddaf5b1"></span>std::vector&lt;size_t&gt; <code class="descname">bufferSizes_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine12bufferSizes_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine9passType_E">
<span id="paddle::MultiGradientMachine::passType___PassType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a42478ec23e950e8abe2700c8483ac373"></span>PassType <code class="descname">passType_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9passType_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine9taskType_E">
Y
Yu Yang 已提交
832
<span id="paddle::MultiGradientMachine::taskType___TaskType"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a4c5b36c045500b9848d69dd06b04221f"></span><a class="reference internal" href="#_CPPv2N6paddle20MultiGradientMachine8TaskTypeE" title="paddle::MultiGradientMachine::TaskType">TaskType</a> <code class="descname">taskType_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine9taskType_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
833 834 835 836
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine10gradQueue_E">
Y
Yu Yang 已提交
837
<span id="paddle::MultiGradientMachine::gradQueue___PidQueue"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a47cb4eca0d67fa9a4515d8c17a70968b"></span>PidQueue <code class="descname">gradQueue_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine10gradQueue_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine7inArgs_E">
<span id="paddle::MultiGradientMachine::inArgs___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1acdcd8132892a645c5ebad3085674d244"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">inArgs_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine7inArgs_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine8outArgs_E">
<span id="paddle::MultiGradientMachine::outArgs___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a8866ab3c8e849ea01544311d5dbcb52d"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">outArgs_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine8outArgs_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine13outArgStream_E">
<span id="paddle::MultiGradientMachine::outArgStream___hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1aa77f4d5a7030df3e7ddee03b9385b6dc"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <code class="descname">outArgStream_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13outArgStream_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine11mergeTypes_E">
<span id="paddle::MultiGradientMachine::mergeTypes___std::vector:ParameterType:"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a35a41c082663fc3fa5a316e754663865"></span>std::vector&lt;ParameterType&gt; <code class="descname">mergeTypes_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11mergeTypes_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
858 859
<dd><p>ParameterType which needs to be merged from each GPU. </p>
</dd></dl>
Y
Yu Yang 已提交
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine11numDevices_E">
<span id="paddle::MultiGradientMachine::numDevices___i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a41400a3157af57c1031b5198d5cc271d"></span>int <code class="descname">numDevices_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11numDevices_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine18numLogicalDevices_E">
<span id="paddle::MultiGradientMachine::numLogicalDevices___i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a724d2b7fc65a6afaf52dbf685a9e02e3"></span>int <code class="descname">numLogicalDevices_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine18numLogicalDevices_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine11numThreads_E">
<span id="paddle::MultiGradientMachine::numThreads___i"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab6bdfb46315efa773d8d550a0571f0dd"></span>int <code class="descname">numThreads_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11numThreads_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine17backwardCallback_E">
<span id="paddle::MultiGradientMachine::backwardCallback___UpdateCallback"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a5bf1dc53c86db84f6e23732f4e22ded2"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> <code class="descname">backwardCallback_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine17backwardCallback_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine15trainerBarrier_E">
<span id="paddle::MultiGradientMachine::trainerBarrier___ThreadBarrier"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1af613543bad158735471a2fcc0e57c5e9"></span><a class="reference internal" href="../../utils/thread.html#_CPPv2N6paddle13ThreadBarrierE" title="paddle::ThreadBarrier">ThreadBarrier</a> <code class="descname">trainerBarrier_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine15trainerBarrier_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
884 885
<dd><p>barrrier for threads_ </p>
</dd></dl>
Y
Yu Yang 已提交
886 887 888 889

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine11allBarrier_E">
<span id="paddle::MultiGradientMachine::allBarrier___ThreadBarrier"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a6687b5a73445fcde7edbc475e5f950ab"></span><a class="reference internal" href="../../utils/thread.html#_CPPv2N6paddle13ThreadBarrierE" title="paddle::ThreadBarrier">ThreadBarrier</a> <code class="descname">allBarrier_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11allBarrier_E" title="Permalink to this definition"></a></dt>
890
<dd><p>barrier for both <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine"><span class="std std-ref">MultiGradientMachine</span></a> and threds_ </p>
Y
Yu Yang 已提交
891
</dd></dl>
Y
Yu Yang 已提交
892 893 894 895

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine13inArgsCopied_E">
<span id="paddle::MultiGradientMachine::inArgsCopied___b"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1ab9854a9e4941edbab7532f15a467adf8"></span>bool <code class="descname">inArgsCopied_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine13inArgsCopied_E" title="Permalink to this definition"></a></dt>
896
<dd><p>indicate whether inArgs is copied before <a class="reference internal" href="#paddleclasspaddle_1_1MultiGradientMachine_1a5a59dce9a806c890b968116444c1c051"><span class="std std-ref">forward()</span></a> </p>
Y
Yu Yang 已提交
897
</dd></dl>
Y
Yu Yang 已提交
898 899 900 901

<dl class="member">
<dt id="_CPPv2N6paddle20MultiGradientMachine11isPassGrad_E">
<span id="paddle::MultiGradientMachine::isPassGrad___b"></span><span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1afe957c573c30a65a087eb8c67377347b"></span>bool <code class="descname">isPassGrad_</code><a class="headerlink" href="#_CPPv2N6paddle20MultiGradientMachine11isPassGrad_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
902 903
<dd><p>Whether to copy the gradient back from an external input. </p>
</dd></dl>
Y
Yu Yang 已提交
904 905 906 907 908 909

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Friends</p>
<dl class="function">
<dt>
Y
Yu Yang 已提交
910
<span class="target" id="paddleclasspaddle_1_1MultiGradientMachine_1a4d4f69f7b40040a17b6067ca20998681"></span><em class="property">friend </em><code class="descname">paddle::MultiGradientMachine::TrainerThread</code></dt>
Y
Yu Yang 已提交
911 912 913 914 915
<dd></dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
916 917
<div class="section" id="trainerthread">
<h3>TrainerThread<a class="headerlink" href="#trainerthread" title="Permalink to this headline"></a></h3>
Y
Yu Yang 已提交
918 919
<dl class="class">
<dt id="_CPPv2N6paddle13TrainerThreadE">
Y
Yu Yang 已提交
920
<span id="paddle::TrainerThread"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">TrainerThread</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThreadE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread13TrainerThreadERK11ModelConfigiP20MultiGradientMachine">
<span id="paddle::TrainerThread::TrainerThread__ModelConfigCR.i.MultiGradientMachineP"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1afa58688d6bdf625fceaf23a3c4992efe"></span><code class="descname">TrainerThread</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em>, int <em>threadId</em>, <a class="reference internal" href="#_CPPv2N6paddle20MultiGradientMachineE" title="paddle::MultiGradientMachine">MultiGradientMachine</a> *<em>multiMachine</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13TrainerThreadERK11ModelConfigiP20MultiGradientMachine" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThreadD0Ev">
<span id="paddle::TrainerThread::~TrainerThread"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a354e4c2b6b6b0a5d97c43eeb83e1e5cd"></span><code class="descname">~TrainerThread</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThreadD0Ev" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread5startEv">
<span id="paddle::TrainerThread::start"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a30e2b3b12ce3732c10ce91027fabbb48"></span>void <code class="descname">start</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread5startEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread9onPassEndEv">
<span id="paddle::TrainerThread::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a10265ef5c473cc6dd2c54da616b6743c"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread9onPassEndEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread16waitOutArgsReadyEv">
<span id="paddle::TrainerThread::waitOutArgsReady"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ae4f58da92d184b25f3c608c545881d04"></span>void <code class="descname">waitOutArgsReady</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16waitOutArgsReadyEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread15notifyTaskReadyEv">
<span id="paddle::TrainerThread::notifyTaskReady"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1af0927c55397766a837a535004f9e12b9"></span>void <code class="descname">notifyTaskReady</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread15notifyTaskReadyEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread11getDeviceIdEv">
<span id="paddle::TrainerThread::getDeviceId"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a8f5bcc2dbddf0213c0f6ee476456fe38"></span>int <code class="descname">getDeviceId</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle13TrainerThread11getDeviceIdEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread18getGradientMachineEv">
<span id="paddle::TrainerThread::getGradientMachine"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1acb60f35c5832c010cd0ec176eef21a74"></span><a class="reference internal" href="#_CPPv2N6paddle15GradientMachineE" title="paddle::GradientMachine">GradientMachine</a> *<code class="descname">getGradientMachine</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread18getGradientMachineEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread13getParametersEv">
<span id="paddle::TrainerThread::getParameters"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a4a508a635acfebac8e1ef290d694dc91"></span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; &amp;<code class="descname">getParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13getParametersEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread4stopEv">
<span id="paddle::TrainerThread::stop"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a60fe79e7806a868d4d124a85946149e7"></span>void <code class="descname">stop</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread4stopEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread16notifyValueReadyEi">
<span id="paddle::TrainerThread::notifyValueReady__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a8c94d6c08e1ff36f264488d98c566bb2"></span>void <code class="descname">notifyValueReady</code><span class="sig-paren">(</span>int <em>paramId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16notifyValueReadyEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread11getValueBufEi">
<span id="paddle::TrainerThread::getValueBuf__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a8510e5b8afa5cc3742a1da4c79c5caca"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9VectorPtrE" title="paddle::VectorPtr">VectorPtr</a> &amp;<code class="descname">getValueBuf</code><span class="sig-paren">(</span>int <em>paramId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread11getValueBufEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread10getOutArgsEv">
<span id="paddle::TrainerThread::getOutArgs"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1abed6af9e035bba440d4049b8da7e7199"></span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<code class="descname">getOutArgs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread10getOutArgsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread16incUpdateCounterEi">
<span id="paddle::TrainerThread::incUpdateCounter__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a6a59f3e5374ae5b9e88058a30ccdf713"></span>void <code class="descname">incUpdateCounter</code><span class="sig-paren">(</span>int <em>n</em> = 1<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16incUpdateCounterEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread21notifyGradientCollectEi">
<span id="paddle::TrainerThread::notifyGradientCollect__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a124498cc719dc8d811bfa71721824959"></span>void <code class="descname">notifyGradientCollect</code><span class="sig-paren">(</span>int <em>paramId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread21notifyGradientCollectEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread22notifyCopyGradToBufferEi">
<span id="paddle::TrainerThread::notifyCopyGradToBuffer__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a869d67ac5492de00d2ed1923bf27b7bf"></span>void <code class="descname">notifyCopyGradToBuffer</code><span class="sig-paren">(</span>int <em>paramId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread22notifyCopyGradToBufferEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread19notifyValueDispatchEi">
<span id="paddle::TrainerThread::notifyValueDispatch__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a4ee9f59d1fcd8e5fb32cef7d8f9f327c"></span>void <code class="descname">notifyValueDispatch</code><span class="sig-paren">(</span>int <em>paramId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread19notifyValueDispatchEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread8prefetchEv">
<span id="paddle::TrainerThread::prefetch"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1aa7d58707a2772930e8dff4a3815778eb"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread8prefetchEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread14copyOutputGradEv">
<span id="paddle::TrainerThread::copyOutputGrad"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a06970cc4cba91ae9b25a84afb7301ed4"></span>void <code class="descname">copyOutputGrad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread14copyOutputGradEv" title="Permalink to this definition"></a></dt>
1016
<dd><p>copy the output gradient from the main <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine"><span class="std std-ref">GradientMachine</span></a>. </p>
Y
Yu Yang 已提交
1017
</dd></dl>
Y
Yu Yang 已提交
1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread17mergeCpuGradientsEv">
<span id="paddle::TrainerThread::mergeCpuGradients"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a5181b0a735bd0654c972eb8b7a861499"></span>void <code class="descname">mergeCpuGradients</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread17mergeCpuGradientsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread15mergeGradSparseEP9ParameterRNSt6vectorIPKNSt6vectorI12ParameterPtrEEEE">
<span id="paddle::TrainerThread::mergeGradSparse__ParameterP.std::vector:std::vector:ParameterPtr:CP:R"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a9b14d7b2aef6ae8719fb22547eef12e2"></span>void <code class="descname">mergeGradSparse</code><span class="sig-paren">(</span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle9ParameterE" title="paddle::Parameter">Parameter</a> *<em>para</em>, std::vector&lt;<em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; *&gt; &amp;<em>slaveParameters</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread15mergeGradSparseEP9ParameterRNSt6vectorIPKNSt6vectorI12ParameterPtrEEEE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread21mergeGradSparseRemoteEP9ParameterRNSt6vectorIPKNSt6vectorI12ParameterPtrEEEE">
<span id="paddle::TrainerThread::mergeGradSparseRemote__ParameterP.std::vector:std::vector:ParameterPtr:CP:R"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1aa4f0a2ef95ff7979b4375050c57a5c44"></span>void <code class="descname">mergeGradSparseRemote</code><span class="sig-paren">(</span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle9ParameterE" title="paddle::Parameter">Parameter</a> *<em>para</em>, std::vector&lt;<em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; *&gt; &amp;<em>slaveParameters</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread21mergeGradSparseRemoteEP9ParameterRNSt6vectorIPKNSt6vectorI12ParameterPtrEEEE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread14mergeGradDenseEP9ParameterRNSt6vectorIPKNSt6vectorI12ParameterPtrEEEE">
<span id="paddle::TrainerThread::mergeGradDense__ParameterP.std::vector:std::vector:ParameterPtr:CP:R"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a2a4753a0ba6a8e5327b0ad034e84d8d0"></span>void <code class="descname">mergeGradDense</code><span class="sig-paren">(</span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle9ParameterE" title="paddle::Parameter">Parameter</a> *<em>para</em>, std::vector&lt;<em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; *&gt; &amp;<em>slaveParameters</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread14mergeGradDenseEP9ParameterRNSt6vectorIPKNSt6vectorI12ParameterPtrEEEE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread13computeThreadEv">
<span id="paddle::TrainerThread::computeThread"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ae53af9510f80b5ecbeab88244e0ea2cc"></span>void <code class="descname">computeThread</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13computeThreadEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread19valueDispatchThreadEv">
<span id="paddle::TrainerThread::valueDispatchThread"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a32d308af4c36df344a790beacd8e5571"></span>void <code class="descname">valueDispatchThread</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread19valueDispatchThreadEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread22copyGradToBufferThreadEv">
<span id="paddle::TrainerThread::copyGradToBufferThread"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a469c59cc05ebbcefa80ac2fd70794bbe"></span>void <code class="descname">copyGradToBufferThread</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread22copyGradToBufferThreadEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread17gradCollectThreadEv">
<span id="paddle::TrainerThread::gradCollectThread"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a8e901762e407648511cbd07d466663cc"></span>void <code class="descname">gradCollectThread</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread17gradCollectThreadEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread10copyInArgsEv">
<span id="paddle::TrainerThread::copyInArgs"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a912cfaa3996339c12c89c92eeb83d5b3"></span>void <code class="descname">copyInArgs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread10copyInArgsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread7forwardEv">
<span id="paddle::TrainerThread::forward"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a058cf89c58cdf58a04b26c302f0c4b5a"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread7forwardEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread8backwardEv">
<span id="paddle::TrainerThread::backward"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ad80e4f6560ba28b07a64e925579351cb"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread8backwardEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread16backwardCallbackEP9Parameter">
<span id="paddle::TrainerThread::backwardCallback__ParameterP"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1aa4df27dc100ebf8d55dd5694b1e6b1e7"></span>void <code class="descname">backwardCallback</code><span class="sig-paren">(</span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle9ParameterE" title="paddle::Parameter">Parameter</a> *<em>para</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16backwardCallbackEP9Parameter" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13TrainerThread10doCallbackEi">
<span id="paddle::TrainerThread::doCallback__i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a8b3affe8e691817c3c885ff9611b93f3"></span>void <code class="descname">doCallback</code><span class="sig-paren">(</span>int <em>pid</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread10doCallbackEi" title="Permalink to this definition"></a></dt>
1085
<dd><p>call the actuall callback supplied by the caller of <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine_1a5a6d89a9412849259e07729720c4b2cc"><span class="std std-ref">GradientMachine::backward</span></a> </p>
Y
Yu Yang 已提交
1086
</dd></dl>
Y
Yu Yang 已提交
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread13multiMachine_E">
<span id="paddle::TrainerThread::multiMachine___MultiGradientMachineP"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a7e4185df090dc3f4f2622255fb516f26"></span><a class="reference internal" href="#_CPPv2N6paddle20MultiGradientMachineE" title="paddle::MultiGradientMachine">MultiGradientMachine</a> *<code class="descname">multiMachine_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13multiMachine_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread7config_E">
<span id="paddle::TrainerThread::config___ModelConfig"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a0e256ee85e3fd1b88ca0a29386eba8dc"></span><a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> <code class="descname">config_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread7config_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread9stopping_E">
<span id="paddle::TrainerThread::stopping___b"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a3f1868b0248e7e397daea07ee09672f2"></span>bool <code class="descname">stopping_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread9stopping_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1104 1105
<dd><p>whether the thread should stop </p>
</dd></dl>
Y
Yu Yang 已提交
1106 1107 1108 1109

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread10partnerId_E">
<span id="paddle::TrainerThread::partnerId___i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ae69bab6600c6b3eaca5ed54f0fbb1056"></span>int <code class="descname">partnerId_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread10partnerId_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1110 1111
<dd><p>the threads form which to collect gradient </p>
</dd></dl>
Y
Yu Yang 已提交
1112 1113 1114 1115

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread9threadId_E">
<span id="paddle::TrainerThread::threadId___i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a4a3732d255726ebbaf21fd7e52b0112c"></span>int <code class="descname">threadId_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread9threadId_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1116 1117
<dd><p>from 0 to threads-1 </p>
</dd></dl>
Y
Yu Yang 已提交
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread9deviceId_E">
<span id="paddle::TrainerThread::deviceId___i"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a95c2faab17e49ce6664e18b0949fe07a"></span>int <code class="descname">deviceId_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread9deviceId_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread16gradientMachine_E">
<span id="paddle::TrainerThread::gradientMachine___std::unique_ptr:GradientMachine:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ab7591fb654abefdcbbf77f38027dd3ad"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15GradientMachineE" title="paddle::GradientMachine">GradientMachine</a>&gt; <code class="descname">gradientMachine_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16gradientMachine_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread11parameters_E">
<span id="paddle::TrainerThread::parameters___std::vector:ParameterPtr:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a1726a740815e6703f503007fac04bba6"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; <code class="descname">parameters_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread11parameters_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread11mergeTypes_E">
<span id="paddle::TrainerThread::mergeTypes___std::vector:ParameterType:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a75b952523baacde2f320d355ba470c68"></span>std::vector&lt;ParameterType&gt; <code class="descname">mergeTypes_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread11mergeTypes_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1137 1138
<dd><p>ParameterType which needs to be merged from each GPU. </p>
</dd></dl>
Y
Yu Yang 已提交
1139 1140 1141 1142

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread14computeThread_E">
<span id="paddle::TrainerThread::computeThread___std::unique_ptr:std::thread:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a1df1e457f840b28e1038fa4a700872d7"></span>std::unique_ptr&lt;std::thread&gt; <code class="descname">computeThread_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread14computeThread_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1143 1144
<dd><p>compute thread </p>
</dd></dl>
Y
Yu Yang 已提交
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread7inArgs_E">
<span id="paddle::TrainerThread::inArgs___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ac79c9647494a945c0a2df4ebe8d1686e"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">inArgs_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread7inArgs_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread8outArgs_E">
<span id="paddle::TrainerThread::outArgs___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a4548994e7bfbe74cb90cf02a51749f83"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">outArgs_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread8outArgs_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread13taskReadySem_E">
<span id="paddle::TrainerThread::taskReadySem___Semaphore"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ae9b1fe7658dd5fd39d4d61e67178a583"></span><a class="reference internal" href="../../utils/thread.html#_CPPv2N6paddle9SemaphoreE" title="paddle::Semaphore">Semaphore</a> <code class="descname">taskReadySem_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13taskReadySem_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread16outArgsReadySem_E">
<span id="paddle::TrainerThread::outArgsReadySem___Semaphore"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ae8ad1d7cd56087d1b24169d1619efe01"></span><a class="reference internal" href="../../utils/thread.html#_CPPv2N6paddle9SemaphoreE" title="paddle::Semaphore">Semaphore</a> <code class="descname">outArgsReadySem_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16outArgsReadySem_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread11copyThread_E">
<span id="paddle::TrainerThread::copyThread___std::unique_ptr:std::thread:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a4d77b604c238da37fa5bbd9168d46c27"></span>std::unique_ptr&lt;std::thread&gt; <code class="descname">copyThread_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread11copyThread_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1169 1170
<dd><p>copy thread </p>
</dd></dl>
Y
Yu Yang 已提交
1171 1172 1173

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread13gradBufQueue_E">
Y
Yu Yang 已提交
1174 1175 1176
<span id="paddle::TrainerThread::gradBufQueue___PidQueue"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a24ddc28ed26e980505546ba83c9043cd"></span>PidQueue <code class="descname">gradBufQueue_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13gradBufQueue_E" title="Permalink to this definition"></a></dt>
<dd><p>queue of gradient needs to be copied to partner </p>
</dd></dl>
Y
Yu Yang 已提交
1177 1178 1179 1180 1181 1182 1183 1184 1185

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread11gradStream_E">
<span id="paddle::TrainerThread::gradStream___hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1ad5aa5ed29dcd90c34b91d9407147ed58"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <code class="descname">gradStream_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread11gradStream_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread18gradCollectThread_E">
<span id="paddle::TrainerThread::gradCollectThread___std::unique_ptr:std::thread:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a9d461dfb8130bb51c8eacbb2186618df"></span>std::unique_ptr&lt;std::thread&gt; <code class="descname">gradCollectThread_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread18gradCollectThread_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1186 1187
<dd><p>grad merge thread </p>
</dd></dl>
Y
Yu Yang 已提交
1188 1189 1190

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread10gradQueue_E">
Y
Yu Yang 已提交
1191 1192 1193
<span id="paddle::TrainerThread::gradQueue___PidQueue"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a367c33a2cd2bf7d683ba7119b963a586"></span>PidQueue <code class="descname">gradQueue_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread10gradQueue_E" title="Permalink to this definition"></a></dt>
<dd><p>queue of gradient needs to be merged with gradient coopied by copyGradToBufferThread </p>
</dd></dl>
Y
Yu Yang 已提交
1194 1195 1196 1197 1198 1199 1200 1201 1202

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread17backwardCallback_E">
<span id="paddle::TrainerThread::backwardCallback___UpdateCallback"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1af3e55526c519cb85f6b14fcd12861348"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> <code class="descname">backwardCallback_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread17backwardCallback_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread20valueDispatchThread_E">
<span id="paddle::TrainerThread::valueDispatchThread___std::unique_ptr:std::thread:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a3da3201f2a7c46e2eb7c1c6c94c1a614"></span>std::unique_ptr&lt;std::thread&gt; <code class="descname">valueDispatchThread_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread20valueDispatchThread_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1203 1204
<dd><p>value dispatch thread </p>
</dd></dl>
Y
Yu Yang 已提交
1205 1206 1207

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread16valueReadyQueue_E">
Y
Yu Yang 已提交
1208 1209 1210
<span id="paddle::TrainerThread::valueReadyQueue___PidQueue"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1aa8201cce21e13545adfbf83067f749af"></span>PidQueue <code class="descname">valueReadyQueue_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread16valueReadyQueue_E" title="Permalink to this definition"></a></dt>
<dd><p>queue of the parameter whose the vale are ready for copy </p>
</dd></dl>
Y
Yu Yang 已提交
1211 1212 1213 1214

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread15valueReadyCond_E">
<span id="paddle::TrainerThread::valueReadyCond___LockedCondition"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a9aa85b47d60f2568f238421c198b2084"></span><a class="reference internal" href="../../utils/thread.html#_CPPv2N6paddle15LockedConditionE" title="paddle::LockedCondition">LockedCondition</a> <code class="descname">valueReadyCond_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread15valueReadyCond_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1215 1216
<dd><p>used to notify all the parameter values are ready </p>
</dd></dl>
Y
Yu Yang 已提交
1217 1218 1219 1220 1221 1222 1223 1224 1225

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread12valueStream_E">
<span id="paddle::TrainerThread::valueStream___hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a9afac36f9c7f65908224e7b0cd44c248"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <code class="descname">valueStream_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread12valueStream_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread14updateCounter_E">
<span id="paddle::TrainerThread::updateCounter___std::atomic:i:"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a7f82c2c95276b28ffe24f2873e87e608"></span>std::atomic&lt;int&gt; <code class="descname">updateCounter_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread14updateCounter_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1226 1227
<dd><p>how many parameters are updated </p>
</dd></dl>
Y
Yu Yang 已提交
1228 1229 1230 1231 1232 1233 1234 1235 1236

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread17parameterUpdated_E">
<span id="paddle::TrainerThread::parameterUpdated___b"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a7f7085ffd0517c68bd0d933c8e230e57"></span>bool <code class="descname">parameterUpdated_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread17parameterUpdated_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13TrainerThread13inArgsCopied_E">
<span id="paddle::TrainerThread::inArgsCopied___b"></span><span class="target" id="paddleclasspaddle_1_1TrainerThread_1a4ff177ad1d60391eff1ae1d1b967d53c"></span>bool <code class="descname">inArgsCopied_</code><a class="headerlink" href="#_CPPv2N6paddle13TrainerThread13inArgsCopied_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1237
<dd><p>indicate whether inArgs is copied before forward() </p>
Y
Yu Yang 已提交
1238 1239
</dd></dl>

Y
Yu Yang 已提交
1240
</div>
Y
Yu Yang 已提交
1241 1242
</dd></dl>

Y
Yu Yang 已提交
1243
</div>
Y
Yu Yang 已提交
1244 1245 1246
</div>
<div class="section" id="recurrent-gradient-machines">
<h2>Recurrent Gradient Machines<a class="headerlink" href="#recurrent-gradient-machines" title="Permalink to this headline"></a></h2>
Y
Yu Yang 已提交
1247
<dl class="class">
Y
Yu Yang 已提交
1248
<dt id="_CPPv2N6paddle24RecurrentGradientMachineE">
Y
Yu Yang 已提交
1249
<span id="paddle::RecurrentGradientMachine"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">RecurrentGradientMachine</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachineE" title="Permalink to this definition"></a></dt>
1250
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork"><span class="std std-ref">paddle::NeuralNetwork</span></a></p>
Y
Yu Yang 已提交
1251 1252 1253 1254
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine34BeamSearchCandidatesAdjustCallbackE">
Y
Yu Yang 已提交
1255
<span id="paddle::RecurrentGradientMachine::BeamSearchCandidatesAdjustCallback"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a37bbd149f3d674e3ac7634dd182f15f6"></span><em class="property">typedef </em>std::function&lt;void<span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;std::vector&lt;int&gt; *&gt;&amp;, <a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *, <em class="property">const</em> int<span class="sig-paren">)</span>&gt; <code class="descname">BeamSearchCandidatesAdjustCallback</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine34BeamSearchCandidatesAdjustCallbackE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1256 1257 1258 1259 1260 1261 1262 1263 1264
<dd><p>BeamSearchCandidatesAdjustCallback. </p>
<p>Adjust searching candidates to restrict beam search searching within a limited subset of all possibile paths.</p>
<p>The first parameter is the prefixes of all formed paths in current beam search step, whose type is basically int[][].</p>
<p>The second parameter is a pointer to the network used to generate sequence, user can use this pointer to tranverse each layer in the network to modify behaivors of a particular layer.</p>
<p>The third parameter is an integer to indicate the iteration number of beam search, so that user can customize different operations in different beam search iterations. </p>
</dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12DropCallbackE">
1265
<span id="paddle::RecurrentGradientMachine::DropCallback"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1accd7732ad5b94afc5571bdd98396af1e"></span><em class="property">typedef </em>std::function&lt;bool<span class="sig-paren">(</span>int seqId, <em class="property">const</em> std::vector&lt;int&gt;&amp;, <em class="property">const</em> std::vector&lt;real&gt;&amp;<span class="sig-paren">)</span>&gt; <code class="descname">DropCallback</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12DropCallbackE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1266 1267 1268 1269 1270 1271 1272 1273 1274 1275
<dd><p>DropCallback. </p>
<p>Drop a whole prefix or one candidate in beam search or not.</p>
<p>The first parameter is sequence index in a batch</p>
<p>The second parameter is one path in beam search, which is made up of node indices.</p>
<p>The third parameter is probabilites for each node in this path.</p>
<p>Return true if this prefix or candidate is expected to be dropped. </p>
</dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine22NormOrDropNodeCallbackE">
1276
<span id="paddle::RecurrentGradientMachine::NormOrDropNodeCallback"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a8f7d01809d1118665ec62042b1397379"></span><em class="property">typedef </em>std::function&lt;void<span class="sig-paren">(</span>int seqId, <em class="property">const</em> std::vector&lt;int&gt;&amp;, std::vector&lt;real&gt;&amp;, real *<span class="sig-paren">)</span>&gt; <code class="descname">NormOrDropNodeCallback</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine22NormOrDropNodeCallbackE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
<dd><p>NormOrDropNodeCallback. </p>
<p>Normalize a path&#8217;s probabilities or just drop it by modifying path.logProb</p>
<p>The first parameter is sequence index in a batch</p>
<p>The second parameter is path.ids</p>
<p>The third parameter is probabilites for each node in this path.</p>
<p>The fourth parameter is the probability of the whole path. </p>
</dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine16EachStepCallbackE">
<span id="paddle::RecurrentGradientMachine::EachStepCallback"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a9df6e7dcacf87b3b7cdf20fe90ef53a9"></span><em class="property">typedef </em>std::function&lt;void<span class="sig-paren">(</span>int<span class="sig-paren">)</span>&gt; <code class="descname">EachStepCallback</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine16EachStepCallbackE" title="Permalink to this definition"></a></dt>
<dd><p>EachStepCallback. </p>
<p>Invoke with beam search step. </p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine24RecurrentGradientMachineERKNSt6stringEP13NeuralNetwork">
Y
Yu Yang 已提交
1297
<span id="paddle::RecurrentGradientMachine::RecurrentGradientMachine__ssCR.NeuralNetworkP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a4d5b7ecf86cf6ae6712138245812a33c"></span><code class="descname">RecurrentGradientMachine</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>subModelName</em>, <a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<em>rootNetwork</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine24RecurrentGradientMachineERKNSt6stringEP13NeuralNetwork" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1298 1299 1300 1301 1302 1303 1304 1305 1306
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine24RecurrentGradientMachineERK24RecurrentGradientMachine">
<span id="paddle::RecurrentGradientMachine::RecurrentGradientMachine__RecurrentGradientMachineCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a78b48fcdb889e9eaa0bfc8e073e1d95f"></span><code class="descname">RecurrentGradientMachine</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine24RecurrentGradientMachineERKNSt6stringEP13NeuralNetwork" title="paddle::RecurrentGradientMachine::RecurrentGradientMachine">RecurrentGradientMachine</a> &amp;<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine24RecurrentGradientMachineERK24RecurrentGradientMachine" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachineaSERK24RecurrentGradientMachine">
1307
<span id="paddle::RecurrentGradientMachine::assign-operator__RecurrentGradientMachineCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1afbc1b24f3ee91fed4cdce699c35a4b37"></span><a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachineE" title="paddle::RecurrentGradientMachine">RecurrentGradientMachine</a> &amp;<code class="descname">operator=</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachineE" title="paddle::RecurrentGradientMachine">RecurrentGradientMachine</a> &amp;<em>other</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachineaSERK24RecurrentGradientMachine" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachineD0Ev">
<span id="paddle::RecurrentGradientMachine::~RecurrentGradientMachine"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ad6bcd2d534cf5e9054600e1789465457"></span><code class="descname">~RecurrentGradientMachine</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachineD0Ev" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4initERK11ModelConfig17ParamInitCallbackRKNSt6vectorI13ParameterTypeEEb">
<span id="paddle::RecurrentGradientMachine::init__ModelConfigCR.ParamInitCallback.std::vector:ParameterType:CR.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a881efd707246c50b487e0e9064d016d4"></span>void <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle17ParamInitCallbackE" title="paddle::ParamInitCallback">ParamInitCallback</a> <em>callback</em>, <em class="property">const</em> std::vector&lt;ParameterType&gt; &amp;<em>parameterTypes</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4initERK11ModelConfig17ParamInitCallbackRKNSt6vectorI13ParameterTypeEEb" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine8prefetchERKNSt6vectorI8ArgumentEE">
<span id="paddle::RecurrentGradientMachine::prefetch__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a6035ec59b42b6034d21ee20d308298be"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine8prefetchERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
<dd><p>Prefetch row ids of sparse parameter. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType">
<span id="paddle::RecurrentGradientMachine::forward__std::vector:Argument:CR.std::vector:Argument:P.PassType"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ab90c1bd4e2a64065d0a0c49870092f00"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType" title="Permalink to this definition"></a></dt>
<dd><p>Forward propagation. </p>
<p>Calculate outputs (outArgs) based the inputs (inArgs)</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
1333
<dd>: if passType==PASS_TEST, then <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1a6557422f374578bea885ed90a4f3e0b8"><span class="std std-ref">backward()</span></a> should not be called </dd>
Y
Yu Yang 已提交
1334 1335 1336 1337 1338 1339 1340 1341 1342
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine8backwardERK14UpdateCallback">
<span id="paddle::RecurrentGradientMachine::backward__UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a6557422f374578bea885ed90a4f3e0b8"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine8backwardERK14UpdateCallback" title="Permalink to this definition"></a></dt>
<dd><p>Backward propagation. </p>
<p>Calculate the gradient of inArgs and parameter.</p>
1343 1344
<p>This function should only be called after a corresponding <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1ab90c1bd4e2a64065d0a0c49870092f00"><span class="std std-ref">forward()</span></a> call. The caller is responsible for filling the correct grad for the outArgs obtained using <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1ab90c1bd4e2a64065d0a0c49870092f00"><span class="std std-ref">forward()</span></a>.</p>
<p>It may also change the grad field for the inArgs supplied at <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1ab90c1bd4e2a64065d0a0c49870092f00"><span class="std std-ref">forward()</span></a> </p>
Y
Yu Yang 已提交
1345 1346 1347 1348 1349
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback">
<span id="paddle::RecurrentGradientMachine::forwardBackward__std::vector:Argument:CR.std::vector:Argument:P.PassType.UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ac01e7dd17f56bf2f6d7e6138395d76c6"></span>void <code class="descname">forwardBackward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback" title="Permalink to this definition"></a></dt>
1350
<dd><p>Combine <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1ab90c1bd4e2a64065d0a0c49870092f00"><span class="std std-ref">forward()</span></a> and <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1a6557422f374578bea885ed90a4f3e0b8"><span class="std std-ref">backward()</span></a>. For multithread training, this may be faster.</p>
Y
Yu Yang 已提交
1351 1352
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
1353
<dd>: passType PASS_TEST is not allowed for <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine_1ac01e7dd17f56bf2f6d7e6138395d76c6"><span class="std std-ref">forwardBackward()</span></a>. </dd>
Y
Yu Yang 已提交
1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine10resetStateEv">
<span id="paddle::RecurrentGradientMachine::resetState"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a7968c261d4d8f4eab7fffc7ec9ec949f"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine10resetStateEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4evalEP9Evaluator">
Y
Yu Yang 已提交
1365
<span id="paddle::RecurrentGradientMachine::eval__EvaluatorP"></span>virtual <span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ac949e48fb583d66e950bed3d3b80692d"></span>void <code class="descname">eval</code><span class="sig-paren">(</span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<em>evaluator</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4evalEP9Evaluator" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469
<dd><p>evaluate using the given evaluator </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15getParameterIdsEv">
<span id="paddle::RecurrentGradientMachine::getParameterIds"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ae431977ff75d4ad89a2cffa6734ec08f"></span><em class="property">const</em> std::vector&lt;int&gt; &amp;<code class="descname">getParameterIds</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15getParameterIdsEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine34registerBeamSearchControlCallbacksERK34BeamSearchCandidatesAdjustCallbackRK22NormOrDropNodeCallbackRK12DropCallback">
<span id="paddle::RecurrentGradientMachine::registerBeamSearchControlCallbacks__BeamSearchCandidatesAdjustCallbackCR.NormOrDropNodeCallbackCR.DropCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a4807d42b9016192a9cefc4b0c75f3ca8"></span>void <code class="descname">registerBeamSearchControlCallbacks</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine34BeamSearchCandidatesAdjustCallbackE" title="paddle::RecurrentGradientMachine::BeamSearchCandidatesAdjustCallback">BeamSearchCandidatesAdjustCallback</a> &amp;<em>adjustBeamSearch</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine22NormOrDropNodeCallbackE" title="paddle::RecurrentGradientMachine::NormOrDropNodeCallback">NormOrDropNodeCallback</a> &amp;<em>normOrDropNode</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine12DropCallbackE" title="paddle::RecurrentGradientMachine::DropCallback">DropCallback</a> &amp;<em>stopBeamSearch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine34registerBeamSearchControlCallbacksERK34BeamSearchCandidatesAdjustCallbackRK22NormOrDropNodeCallbackRK12DropCallback" title="Permalink to this definition"></a></dt>
<dd><p>Register beam search control callbacks. Used for prediction. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">queryBeamSearch</span></code> - <p>Give the sequences already formed, return the nodes expected to be expanded. Input: A pointer to an array holding pathes which have been expanded Return: A pointer to an array holding nodes wanted to be expanded.</p>
</li>
<li><code class="first docutils literal"><span class="pre">dropOneNode</span></code> - <p>Early drop a node in one beam search step. Given the path formed and probability history, decide whether a node should be dropped or not.</p>
</li>
<li><code class="first docutils literal"><span class="pre">stopBeamSearch</span></code> - <p>Early stop a path in one beam search step. Given the path and probability history, decide whether a path should be dropped or not. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine32removeBeamSearchControlCallbacksEv">
<span id="paddle::RecurrentGradientMachine::removeBeamSearchControlCallbacks"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a64f794d01c9b5698ccf0ac1e20f26009"></span>void <code class="descname">removeBeamSearchControlCallbacks</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine32removeBeamSearchControlCallbacksEv" title="Permalink to this definition"></a></dt>
<dd><p>Remove user costumized beam search callbacks,. </p>
<p>make sequence generation acts like normal beam search. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine37registerBeamSearchStatisticsCallbacksERK16EachStepCallbackRK16EachStepCallback">
<span id="paddle::RecurrentGradientMachine::registerBeamSearchStatisticsCallbacks__EachStepCallbackCR.EachStepCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a27c5c51fac520bab48049a276763eaa9"></span>void <code class="descname">registerBeamSearchStatisticsCallbacks</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine16EachStepCallbackE" title="paddle::RecurrentGradientMachine::EachStepCallback">EachStepCallback</a> &amp;<em>onEachStepStarted</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine16EachStepCallbackE" title="paddle::RecurrentGradientMachine::EachStepCallback">EachStepCallback</a> &amp;<em>onEachStepStoped</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine37registerBeamSearchStatisticsCallbacksERK16EachStepCallbackRK16EachStepCallback" title="Permalink to this definition"></a></dt>
<dd><p>register statistics methods for performance profile of beam search. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">onEachStepStarted</span></code> - <p>invoke once a beam search step starts. Its input is index of the beam search step.</p>
</li>
<li><code class="first docutils literal"><span class="pre">onEachStepStoped</span></code> - <p>invoke once a beam search step ends. Its input is index of the beam search step. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine35removeBeamSearchStatisticsCallbacksEv">
<span id="paddle::RecurrentGradientMachine::removeBeamSearchStatisticsCallbacks"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a24c841199d9cc41e06a940e3d3239cc9"></span>void <code class="descname">removeBeamSearchStatisticsCallbacks</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine35removeBeamSearchStatisticsCallbacksEv" title="Permalink to this definition"></a></dt>
<dd><p>Remove beam search callbacks. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine14stopBeamSearchEv">
<span id="paddle::RecurrentGradientMachine::stopBeamSearch"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a476be409072fe7bd92619ebb194bd8f7"></span>void <code class="descname">stopBeamSearch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine14stopBeamSearchEv" title="Permalink to this definition"></a></dt>
<dd><p>Stop beam search for current source. </p>
<p>Will restart beam search in the next forward </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine13getFinalPathsEv">
<span id="paddle::RecurrentGradientMachine::getFinalPaths"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a45b568b602166e97f1070850f601b622"></span><em class="property">const</em> std::vector&lt;std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine4PathE" title="paddle::RecurrentGradientMachine::Path">Path</a>&gt;&gt; &amp;<code class="descname">getFinalPaths</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine13getFinalPathsEv" title="Permalink to this definition"></a></dt>
<dd><p>access beam search results. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>beam search results. </dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine20resizeOrCreateFramesEi">
<span id="paddle::RecurrentGradientMachine::resizeOrCreateFrames__i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a59d0fe50433cf79ccd736bf155c95f8c"></span>void <code class="descname">resizeOrCreateFrames</code><span class="sig-paren">(</span>int <em>numFrames</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine20resizeOrCreateFramesEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15resizeBootFrameEi">
<span id="paddle::RecurrentGradientMachine::resizeBootFrame__i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a01ca412b60c6735ac06bd8da7561d783"></span>void <code class="descname">resizeBootFrame</code><span class="sig-paren">(</span>int <em>numSequences</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15resizeBootFrameEi" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine16generateSequenceEv">
<span id="paddle::RecurrentGradientMachine::generateSequence"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a5327659e84158ea1c21b1a1659bf70be"></span>void <code class="descname">generateSequence</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine16generateSequenceEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12oneWaySearchE6size_t">
<span id="paddle::RecurrentGradientMachine::oneWaySearch__s"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a891c66f8643e32fe5067b67163ddaa05"></span>void <code class="descname">oneWaySearch</code><span class="sig-paren">(</span>size_t <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12oneWaySearchE6size_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine10beamSearchE6size_t">
<span id="paddle::RecurrentGradientMachine::beamSearch__s"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1af037668a227faf876c62d0d97ec9bbde"></span>void <code class="descname">beamSearch</code><span class="sig-paren">(</span>size_t <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine10beamSearchE6size_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
1470 1471
<dt id="_CPPv2N6paddle24RecurrentGradientMachine17createInFrameInfoEiRK8Argument8PassType">
<span id="paddle::RecurrentGradientMachine::createInFrameInfo__i.ArgumentCR.PassType"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1af8481d052b22dfdc4bbdcb15111a93e9"></span>void <code class="descname">createInFrameInfo</code><span class="sig-paren">(</span>int <em>inlinks_id</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>input</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine17createInFrameInfoEiRK8Argument8PassType" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine21createMemoryFrameInfoEP15MemoryFrameLine8PassType">
<span id="paddle::RecurrentGradientMachine::createMemoryFrameInfo__MemoryFrameLineP.PassType"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ac89c3d6bc3847aa6aa5fe47640f409e1"></span>void <code class="descname">createMemoryFrameInfo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLineE" title="paddle::RecurrentGradientMachine::MemoryFrameLine">MemoryFrameLine</a> *<em>memoryFrameLine</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine21createMemoryFrameInfoEP15MemoryFrameLine8PassType" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine13copyScattedIdERNSt6vectorIiEEP10IVectorPtri">
<span id="paddle::RecurrentGradientMachine::copyScattedId__std::vector:i:R.IVectorPtrP.i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a92ec10826593825a823d6ee1706192d2"></span>void <code class="descname">copyScattedId</code><span class="sig-paren">(</span>std::vector&lt;int&gt; &amp;<em>srcIds</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> *<em>dstIds</em>, int <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine13copyScattedIdERNSt6vectorIiEEP10IVectorPtri" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine17selectRowsOneTimeE8LayerPtrRK10IVectorPtrP8Argument8PassType">
<span id="paddle::RecurrentGradientMachine::selectRowsOneTime__LayerPtr.IVectorPtrCR.ArgumentP.PassType"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a25065887ae285ab4c07b2a6ec753f992"></span>void <code class="descname">selectRowsOneTime</code><span class="sig-paren">(</span>LayerPtr <em>layer</em>, <em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> &amp;<em>allIds</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>arg</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine17selectRowsOneTimeE8LayerPtrRK10IVectorPtrP8Argument8PassType" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12createSeqPosERKNSt6vectorIiEEP16ICpuGpuVectorPtr">
<span id="paddle::RecurrentGradientMachine::createSeqPos__std::vector:i:CR.ICpuGpuVectorPtrP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a0a58e6a4c8595b3a3a748065145a5f92"></span>void <code class="descname">createSeqPos</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;int&gt; &amp;<em>sequenceStartPosition</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="paddle::ICpuGpuVectorPtr">ICpuGpuVectorPtr</a> *<em>sequenceStartPositions</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12createSeqPosERKNSt6vectorIiEEP16ICpuGpuVectorPtr" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine13inFrameLines_E">
<span id="paddle::RecurrentGradientMachine::inFrameLines___std::vector:InFrameLine:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1af6a5c167496903298b38b2760e5b2780"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLineE" title="paddle::RecurrentGradientMachine::InFrameLine">InFrameLine</a>&gt; <code class="descname">inFrameLines_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine13inFrameLines_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine14outFrameLines_E">
<span id="paddle::RecurrentGradientMachine::outFrameLines___std::vector:OutFrameLine:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a733ac23584afcb8ba84ebe60881388b7"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLineE" title="paddle::RecurrentGradientMachine::OutFrameLine">OutFrameLine</a>&gt; <code class="descname">outFrameLines_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine14outFrameLines_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine17memoryFrameLines_E">
<span id="paddle::RecurrentGradientMachine::memoryFrameLines___std::vector:MemoryFrameLine:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a36cfcb905e09cb37bb193b3441b1de9d"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLineE" title="paddle::RecurrentGradientMachine::MemoryFrameLine">MemoryFrameLine</a>&gt; <code class="descname">memoryFrameLines_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine17memoryFrameLines_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine5info_E">
1514 1515 1516 1517 1518 1519
<span id="paddle::RecurrentGradientMachine::info___std::vector:Info:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a63e5674b29029a36e5a22b5ee963f8a8"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine4InfoE" title="paddle::RecurrentGradientMachine::Info">Info</a>&gt; <code class="descname">info_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine5info_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine8numSeqs_E">
<span id="paddle::RecurrentGradientMachine::numSeqs___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1af1498cc72c668e04b9f874f80d032201"></span>std::vector&lt;int&gt; <code class="descname">numSeqs_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine8numSeqs_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1520 1521 1522
<dd></dd></dl>

<dl class="member">
1523 1524
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9seqInfos_E">
<span id="paddle::RecurrentGradientMachine::seqInfos___std::vector:std::vector:Argument::SeqInfo::"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ac9ec436a9554dbf3f41bf98f3d244f23"></span>std::vector&lt;std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>::<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8Argument7SeqInfoE" title="paddle::Argument::SeqInfo">SeqInfo</a>&gt;&gt; <code class="descname">seqInfos_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9seqInfos_E" title="Permalink to this definition"></a></dt>
1525 1526 1527 1528 1529
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine19targetInfoInlinkId_E">
<span id="paddle::RecurrentGradientMachine::targetInfoInlinkId___i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a59d12084ac35ba97723ce102b181ade9"></span>int <code class="descname">targetInfoInlinkId_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine19targetInfoInlinkId_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine13eosFrameLine_E">
<span id="paddle::RecurrentGradientMachine::eosFrameLine___std::unique_ptr:EosFrameLine:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1afa8364b6375ddcc343c0863508415bc6"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine12EosFrameLineE" title="paddle::RecurrentGradientMachine::EosFrameLine">EosFrameLine</a>&gt; <code class="descname">eosFrameLine_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine13eosFrameLine_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine10generator_E">
<span id="paddle::RecurrentGradientMachine::generator___Generator"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a6a925d8294a5ba620f3a85059e8548c7"></span><a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine9GeneratorE" title="paddle::RecurrentGradientMachine::Generator">Generator</a> <code class="descname">generator_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine10generator_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine7frames_E">
Y
Yu Yang 已提交
1544
<span id="paddle::RecurrentGradientMachine::frames___std::vector:std::unique_ptr:NeuralNetwork::"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a5fa4e5af9fee4dc4d9502c8445c51a72"></span>std::vector&lt;std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a>&gt;&gt; <code class="descname">frames_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine7frames_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1545 1546 1547 1548
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12rootNetwork_E">
Y
Yu Yang 已提交
1549
<span id="paddle::RecurrentGradientMachine::rootNetwork___NeuralNetworkP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a405692e3d6a809afa2b7f95f4a52e9bc"></span><a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<code class="descname">rootNetwork_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12rootNetwork_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9reversed_E">
<span id="paddle::RecurrentGradientMachine::reversed___b"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1aa8ec1dbb1643984ed079d4814d916098"></span>bool <code class="descname">reversed_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9reversed_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine18maxSequenceLength_E">
<span id="paddle::RecurrentGradientMachine::maxSequenceLength___i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a72f4aaaebdebf3086c516041335a9257"></span>int <code class="descname">maxSequenceLength_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine18maxSequenceLength_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine7useGpu_E">
<span id="paddle::RecurrentGradientMachine::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1aa1be58427ffa11de1f93eb3a19be2d1e"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine7useGpu_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15stopBeamSearch_E">
<span id="paddle::RecurrentGradientMachine::stopBeamSearch___b"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1ae12b72fe81eff4ee1a01c7fe3bd5c64a"></span>bool <code class="descname">stopBeamSearch_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15stopBeamSearch_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine13parameterIds_E">
<span id="paddle::RecurrentGradientMachine::parameterIds___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a3b5af2d21396c364d72ada9a88b620a1"></span>std::vector&lt;int&gt; <code class="descname">parameterIds_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine13parameterIds_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine10evaluator_E">
Y
Yu Yang 已提交
1579
<span id="paddle::RecurrentGradientMachine::evaluator___std::unique_ptr:Evaluator:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a45376bceca1c0686b71fb341c1bdcfd0"></span>std::unique_ptr&lt;<a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a>&gt; <code class="descname">evaluator_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine10evaluator_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9dataArgs_E">
<span id="paddle::RecurrentGradientMachine::dataArgs___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a011b71b5080ae0417962ff62f1898d5c"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">dataArgs_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9dataArgs_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine14dataArgsFrame_E">
<span id="paddle::RecurrentGradientMachine::dataArgsFrame___std::vector:std::vector:Argument::"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a62e6a358fa4358a878d80a7bc62fea68"></span>std::vector&lt;std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt;&gt; <code class="descname">dataArgsFrame_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine14dataArgsFrame_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine13dataArgsSize_E">
<span id="paddle::RecurrentGradientMachine::dataArgsSize___s"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a38cb6a3fa28ef9d51119967d0aaf0039"></span>size_t <code class="descname">dataArgsSize_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine13dataArgsSize_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine6cpuId_E">
<span id="paddle::RecurrentGradientMachine::cpuId___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1aaae891173c16e615665f548de7532158"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">cpuId_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine6cpuId_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine8cpuProb_E">
<span id="paddle::RecurrentGradientMachine::cpuProb___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a9b8cd54778c75d3e9ea05d986f3de7cc"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">cpuProb_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine8cpuProb_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine7cpuEos_E">
<span id="paddle::RecurrentGradientMachine::cpuEos___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1RecurrentGradientMachine_1a1d843e84d8573a5440c7046bad2a4d7c"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">cpuEos_</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine7cpuEos_E" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12EosFrameLineE">
<span id="paddle::RecurrentGradientMachine::EosFrameLine"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1EosFrameLine"></span><em class="property">struct </em><code class="descname">EosFrameLine</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12EosFrameLineE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12EosFrameLine6layersE">
<span id="paddle::RecurrentGradientMachine::EosFrameLine::layers__std::vector:LayerPtr:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1EosFrameLine_1a2fa560b69358d643a37dd5763a2a0cf2"></span>std::vector&lt;LayerPtr&gt; <code class="descname">layers</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12EosFrameLine6layersE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9GeneratorE">
<span id="paddle::RecurrentGradientMachine::Generator"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Generator"></span><em class="property">struct </em><code class="descname">Generator</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9GeneratorE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9Generator6configE">
<span id="paddle::RecurrentGradientMachine::Generator::config__GeneratorConfig"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Generator_1a43a85e0603257138d32a7db2770e3398"></span>GeneratorConfig <code class="descname">config</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9Generator6configE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9Generator3idsE">
<span id="paddle::RecurrentGradientMachine::Generator::ids__std::vector:i:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Generator_1aac311d0b314a1b265a42544fcfc85fcb"></span>std::vector&lt;int&gt; <code class="descname">ids</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9Generator3idsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine9Generator6outArgE">
<span id="paddle::RecurrentGradientMachine::Generator::outArg__Argument"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Generator_1a9b6fe527507bd55b2910f05d9e0e5563"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">outArg</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine9Generator6outArgE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4InfoE">
<span id="paddle::RecurrentGradientMachine::Info"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Info"></span><em class="property">struct </em><code class="descname">Info</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4InfoE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Info6allIdsE">
<span id="paddle::RecurrentGradientMachine::Info::allIds__IVectorPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Info_1abc356e94a3bed9052d5e8cee1a2e3982"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">allIds</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Info6allIdsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Info7idIndexE">
<span id="paddle::RecurrentGradientMachine::Info::idIndex__std::vector:i:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Info_1aea355ba61ba9d699ba086af49ef239f6"></span>std::vector&lt;int&gt; <code class="descname">idIndex</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Info7idIndexE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Info22sequenceStartPositionsE">
<span id="paddle::RecurrentGradientMachine::Info::sequenceStartPositions__ICpuGpuVectorPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Info_1a12a6ce1edafd16bff60a04c2ef98d9f1"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="paddle::ICpuGpuVectorPtr">ICpuGpuVectorPtr</a> <code class="descname">sequenceStartPositions</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Info22sequenceStartPositionsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Info16seqStartPosIndexE">
<span id="paddle::RecurrentGradientMachine::Info::seqStartPosIndex__std::vector:i:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Info_1aa7133af3a0c0c7ae9b21537ae05b826c"></span>std::vector&lt;int&gt; <code class="descname">seqStartPosIndex</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Info16seqStartPosIndexE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine11InFrameLineE">
<span id="paddle::RecurrentGradientMachine::InFrameLine"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1InFrameLine"></span><em class="property">struct </em><code class="descname">InFrameLine</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLineE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine8linkNameE">
<span id="paddle::RecurrentGradientMachine::InFrameLine::linkName__ss"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1InFrameLine_1a0d1893dffa582d7ca8e3f5a2e47af4b0"></span>std::string <code class="descname">linkName</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine8linkNameE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine7inLayerE">
<span id="paddle::RecurrentGradientMachine::InFrameLine::inLayer__LayerPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1InFrameLine_1af0e21452f8600a624c83466344c45146"></span>LayerPtr <code class="descname">inLayer</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine7inLayerE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine6agentsE">
<span id="paddle::RecurrentGradientMachine::InFrameLine::agents__std::vector:LayerPtr:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1InFrameLine_1ac3b1f3e99a88fb2fcb157fe066fc7d26"></span>std::vector&lt;LayerPtr&gt; <code class="descname">agents</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine6agentsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine9hasSubseqE">
<span id="paddle::RecurrentGradientMachine::InFrameLine::hasSubseq__b"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1InFrameLine_1a554372443ea7524bfc3ed0936df1979f"></span>bool <code class="descname">hasSubseq</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine9hasSubseqE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine6outArgE">
<span id="paddle::RecurrentGradientMachine::InFrameLine::outArg__Argument"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1InFrameLine_1afc3ce4b203f0cf187be26090d17bea4b"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">outArg</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine11InFrameLine6outArgE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLineE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine"></span><em class="property">struct </em><code class="descname">MemoryFrameLine</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLineE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9layerNameE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::layerName__ss"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a428d240e37f41e1876dd5a512a503fcd"></span>std::string <code class="descname">layerName</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9layerNameE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine8linkNameE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::linkName__ss"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a6131973563466bc71f3d5a7624d8e13b"></span>std::string <code class="descname">linkName</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine8linkNameE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9bootLayerE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::bootLayer__LayerPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a2a75c88fe1d58716e284f879312df00c"></span>LayerPtr <code class="descname">bootLayer</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9bootLayerE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9biasLayerE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::biasLayer__LayerPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a08a636006e0f5b0f3f33466cb705fe12"></span>LayerPtr <code class="descname">biasLayer</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9biasLayerE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9rootLayerE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::rootLayer__LayerPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a21ddf14390a76091d861e4f82962e522"></span>LayerPtr <code class="descname">rootLayer</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9rootLayerE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9rootAgentE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::rootAgent__LayerPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1ad8d06038ecf879248994938e0f3e1301"></span>LayerPtr <code class="descname">rootAgent</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine9rootAgentE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6framesE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::frames__std::vector:LayerPtr:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a0eaaab4ae2384984a5226516fcca960d"></span>std::vector&lt;LayerPtr&gt; <code class="descname">frames</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6framesE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6agentsE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::agents__std::vector:LayerPtr:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a9e526820fdae81650cbea762dfaf3c29"></span>std::vector&lt;LayerPtr&gt; <code class="descname">agents</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6agentsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine13scatterAgentsE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::scatterAgents__std::vector:LayerPtr:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a25f38cffb0bb9d408ca64219c36aba18"></span>std::vector&lt;LayerPtr&gt; <code class="descname">scatterAgents</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine13scatterAgentsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6outArgE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::outArg__Argument"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a21474d4157105a2cb8748794b5b40dd8"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">outArg</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6outArgE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine11is_sequenceE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::is_sequence__b"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a70ffc99e8f7dc6e22da37f1f618f2980"></span>bool <code class="descname">is_sequence</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine11is_sequenceE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6allIdsE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::allIds__IVectorPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a413b529549b510eac38d4576944411a6"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">allIds</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine6allIdsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine22sequenceStartPositionsE">
<span id="paddle::RecurrentGradientMachine::MemoryFrameLine::sequenceStartPositions__ICpuGpuVectorPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1MemoryFrameLine_1a2b52ca8bc0500b6966d3e76ab5e35cc1"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="paddle::ICpuGpuVectorPtr">ICpuGpuVectorPtr</a> <code class="descname">sequenceStartPositions</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine15MemoryFrameLine22sequenceStartPositionsE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLineE">
<span id="paddle::RecurrentGradientMachine::OutFrameLine"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1OutFrameLine"></span><em class="property">struct </em><code class="descname">OutFrameLine</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLineE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLine9layerNameE">
<span id="paddle::RecurrentGradientMachine::OutFrameLine::layerName__ss"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1OutFrameLine_1a5fff3c4b3c714ed9dab234be06b14eb2"></span>std::string <code class="descname">layerName</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLine9layerNameE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLine10agentLayerE">
<span id="paddle::RecurrentGradientMachine::OutFrameLine::agentLayer__LayerPtr"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1OutFrameLine_1a4941053c758297964463bd20e0313902"></span>LayerPtr <code class="descname">agentLayer</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLine10agentLayerE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLine6framesE">
<span id="paddle::RecurrentGradientMachine::OutFrameLine::frames__std::vector:LayerPtr:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1OutFrameLine_1ac7ddc6f991241c811d812a149eb7c4c3"></span>std::vector&lt;LayerPtr&gt; <code class="descname">frames</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine12OutFrameLine6framesE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4PathE">
<span id="paddle::RecurrentGradientMachine::Path"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path"></span><em class="property">struct </em><code class="descname">Path</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4PathE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path4PathEv">
<span id="paddle::RecurrentGradientMachine::Path::Path"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a2304be332692413fb364922535887487"></span><code class="descname">Path</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path4PathEv" title="Permalink to this definition"></a></dt>
1814
<dd><p><a class="reference internal" href="#paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path"><span class="std std-ref">Path</span></a> default ctor, first logProb is 0. </p>
Y
Yu Yang 已提交
1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path4PathE6size_t">
<span id="paddle::RecurrentGradientMachine::Path::Path__s"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1ac6798883b1696e2fbe4d73648b8f0089"></span><code class="descname">Path</code><span class="sig-paren">(</span>size_t <em>seqId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path4PathE6size_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path4PathER4Pathi4realii">
<span id="paddle::RecurrentGradientMachine::Path::Path__PathR.i.real.i.i"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a7712659327d5eb03fe4c8784eb2aa5b8"></span><code class="descname">Path</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path4PathEv" title="paddle::RecurrentGradientMachine::Path::Path">Path</a> &amp;<em>old</em>, int <em>newId</em>, real <em>logProb</em>, int <em>machineId</em>, int <em>topIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path4PathER4Pathi4realii" title="Permalink to this definition"></a></dt>
<dd><p>Create a new path based on an old path and a new node with probability. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">old</span></code> - <p>old path </p>
</li>
<li><code class="first docutils literal"><span class="pre">newId</span></code> - <p>index of the new node </p>
</li>
<li><code class="first docutils literal"><span class="pre">logProb</span></code> - <p>probability of the new node. </p>
</li>
<li><code class="first docutils literal"><span class="pre">machineId</span></code> - <p>sample index of a frame in RNN </p>
</li>
1837
<li><code class="first docutils literal"><span class="pre">topIndex</span></code> - <p>index of <a class="reference internal" href="../layers/layer.html#paddleclasspaddle_1_1MaxIdLayer"><span class="std std-ref">MaxIdLayer</span></a> output in one sample </p>
Y
Yu Yang 已提交
1838 1839 1840 1841 1842 1843 1844 1845 1846
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4PathltERK4Path">
1847
<span id="paddle::RecurrentGradientMachine::Path::lt-operator__PathCR"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a0bc8efe89c9103470851efbaa0ac7a96"></span>bool <code class="descname">operator&lt;</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine4PathE" title="paddle::RecurrentGradientMachine::Path">Path</a> &amp;<em>other</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4PathltERK4Path" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1848
<dd><p>operator &lt; </p>
1849
<p><a class="reference internal" href="#paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path"><span class="std std-ref">Path</span></a> a &lt; <a class="reference internal" href="#paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path"><span class="std std-ref">Path</span></a> b means log probability of a is smaller than that of b </p>
Y
Yu Yang 已提交
1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path13recordHistoryEv">
<span id="paddle::RecurrentGradientMachine::Path::recordHistory"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a7dd0d19d344b17ccde5bb9ffd59b70fe"></span>void <code class="descname">recordHistory</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path13recordHistoryEv" title="Permalink to this definition"></a></dt>
<dd><p>Start recording history in this path. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path10adjustProbEib">
<span id="paddle::RecurrentGradientMachine::Path::adjustProb__i.b"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1aae0d47f898572a28028f8aabc14abb48"></span>void <code class="descname">adjustProb</code><span class="sig-paren">(</span>int <em>calc_id</em>, bool <em>atEos</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path10adjustProbEib" title="Permalink to this definition"></a></dt>
<dd><p>Adjust probability for DIY beam search interface. In normal situation, it will do nothing. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">calc_id</span></code> - <p>the object id for DIY beam search interface. </p>
</li>
<li><code class="first docutils literal"><span class="pre">atEos</span></code> - <p>at end of sequence or not. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path10isDropableEv">
<span id="paddle::RecurrentGradientMachine::Path::isDropable"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a399f2a0308150a4155060e5d4d55ae12"></span>bool <code class="descname">isDropable</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path10isDropableEv" title="Permalink to this definition"></a></dt>
<dd><p>isDropable indacating whether the current node will be dropped or not in beam search. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>: if logProb is -inf, current node will be dropped. </dd>
<dt><strong>Return</strong></dt>
<dd>true to drop the current node. </dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path3idsE">
<span id="paddle::RecurrentGradientMachine::Path::ids__std::vector:i:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a9b685196a8615a7a3c70834994389eab"></span>std::vector&lt;int&gt; <code class="descname">ids</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path3idsE" title="Permalink to this definition"></a></dt>
<dd><p>ids, path of beam search. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path7logProbE">
<span id="paddle::RecurrentGradientMachine::Path::logProb__real"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a6d2984d7c7a80ca42834ab4455a6786a"></span>real <code class="descname">logProb</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path7logProbE" title="Permalink to this definition"></a></dt>
<dd><p>logProb, current probability of path. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path9machineIdE">
<span id="paddle::RecurrentGradientMachine::Path::machineId__i"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1af144157a16e72d8baad208336a9d543b"></span>int <code class="descname">machineId</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path9machineIdE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path8topIndexE">
<span id="paddle::RecurrentGradientMachine::Path::topIndex__i"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1ad935f25032f61a52da1ac82a1847eef8"></span>int <code class="descname">topIndex</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path8topIndexE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path5seqIdE">
<span id="paddle::RecurrentGradientMachine::Path::seqId__i"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1ac99170f97107ef50c9defb9812b48796"></span>int <code class="descname">seqId</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path5seqIdE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path12machineIdVecE">
<span id="paddle::RecurrentGradientMachine::Path::machineIdVec__std::vector:i:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a86582df0eb9c1bd73b5f921f05683185"></span>std::vector&lt;int&gt; <code class="descname">machineIdVec</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path12machineIdVecE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path11probHistoryE">
<span id="paddle::RecurrentGradientMachine::Path::probHistory__std::vector:real:"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1ac1aa9898d76a3e79b90d8ac1117af983"></span>std::vector&lt;real&gt; <code class="descname">probHistory</code><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path11probHistoryE" title="Permalink to this definition"></a></dt>
<dd><p>A record of each node&#8217;s probality in a formed path in beam search. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
1929
<dd>It could be empty when history is not recorded. If the history is wanted to be recorded, <a class="reference internal" href="#paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1a7dd0d19d344b17ccde5bb9ffd59b70fe"><span class="std std-ref">recordHistory()</span></a> MUST be invoked first. </dd>
Y
Yu Yang 已提交
1930 1931 1932 1933 1934 1935 1936 1937 1938
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24RecurrentGradientMachine4Path11greaterPathERK4PathRK4Path">
1939
<span id="paddle::RecurrentGradientMachine::Path::greaterPath__PathCR.PathCR"></span><span class="target" id="paddlestructpaddle_1_1RecurrentGradientMachine_1_1Path_1afa885405f48dd0935a414d7a5b45dd4f"></span><em class="property">static</em> bool <code class="descname">greaterPath</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine4PathE" title="paddle::RecurrentGradientMachine::Path">Path</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle24RecurrentGradientMachine4PathE" title="paddle::RecurrentGradientMachine::Path">Path</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24RecurrentGradientMachine4Path11greaterPathERK4PathRK4Path" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1940 1941 1942 1943 1944 1945 1946
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

Y
Yu Yang 已提交
1947 1948 1949 1950 1951 1952 1953 1954 1955
</div>
</div>
<div class="section" id="networks">
<h1>Networks<a class="headerlink" href="#networks" title="Permalink to this headline"></a></h1>
<div class="section" id="neuralnetwork">
<h2>NeuralNetwork<a class="headerlink" href="#neuralnetwork" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle13NeuralNetworkE">
<span id="paddle::NeuralNetwork"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">NeuralNetwork</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetworkE" title="Permalink to this definition"></a></dt>
1956 1957
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1GradientMachine"><span class="std std-ref">paddle::GradientMachine</span></a></p>
<p>Subclassed by paddle::MultiNetwork, <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork"><span class="std std-ref">paddle::ParallelNeuralNetwork</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentGradientMachine"><span class="std std-ref">paddle::RecurrentGradientMachine</span></a></p>
Y
Yu Yang 已提交
1958
<div class="breathe-sectiondef container">
Y
Yu Yang 已提交
1959
<p class="breathe-sectiondef-title rubric">Public Functions</p>
Y
Yu Yang 已提交
1960 1961
<dl class="function">
<dt>
Y
Yu Yang 已提交
1962
virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1abd3c7fdc2381efe83c5bf3b99adae259"></span><code class="descname">void paddle::NeuralNetwork::init(const  ModelConfig  &amp; config, ParamInitCallback callback = nullptr, const std::vector&lt; ParameterType &gt; &amp; parameterTypes = std::vector&lt; ParameterType &gt;{PARAMETER_VALUE, PARAMETER_GRADIENT, PARAMETER_MOMENTUM}, bool useGpu = FLAGS_use_gpu)</code></dt>
Y
Yu Yang 已提交
1963 1964
<dd></dd></dl>

Y
Yu Yang 已提交
1965 1966
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork7connectENSt6stringEP13NeuralNetworkNSt6stringE">
1967
<span id="paddle::NeuralNetwork::connect__ss.NeuralNetworkP.ss"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a012563cfb4e8188d6e1e8114338a3306"></span>void <code class="descname">connect</code><span class="sig-paren">(</span>std::string <em>agentLayerName</em>, <a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<em>srcNN</em>, std::string <em>realLayerName</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork7connectENSt6stringEP13NeuralNetworkNSt6stringE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1968 1969
<dd></dd></dl>

Y
Yu Yang 已提交
1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork8prefetchERKNSt6vectorI8ArgumentEE">
<span id="paddle::NeuralNetwork::prefetch__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1ab8f0d007cc4d45e22d5047925102e634"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork8prefetchERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
<dd><p>Prefetch row ids of sparse parameter. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType">
<span id="paddle::NeuralNetwork::forward__std::vector:Argument:CR.std::vector:Argument:P.PassType"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a3023ebddb9e3fcba51e823c414a2fb5c"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType" title="Permalink to this definition"></a></dt>
<dd><p>Forward propagation. </p>
<p>Calculate outputs (outArgs) based the inputs (inArgs)</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
1983
<dd>: if passType==PASS_TEST, then <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork_1a2727fb299c82b8f4d4fca185e4623852"><span class="std std-ref">backward()</span></a> should not be called </dd>
Y
Yu Yang 已提交
1984 1985 1986 1987 1988 1989 1990 1991 1992
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork8backwardERK14UpdateCallback">
<span id="paddle::NeuralNetwork::backward__UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a2727fb299c82b8f4d4fca185e4623852"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork8backwardERK14UpdateCallback" title="Permalink to this definition"></a></dt>
<dd><p>Backward propagation. </p>
<p>Calculate the gradient of inArgs and parameter.</p>
1993 1994
<p>This function should only be called after a corresponding <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork_1a3023ebddb9e3fcba51e823c414a2fb5c"><span class="std std-ref">forward()</span></a> call. The caller is responsible for filling the correct grad for the outArgs obtained using <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork_1a3023ebddb9e3fcba51e823c414a2fb5c"><span class="std std-ref">forward()</span></a>.</p>
<p>It may also change the grad field for the inArgs supplied at <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork_1a3023ebddb9e3fcba51e823c414a2fb5c"><span class="std std-ref">forward()</span></a> </p>
Y
Yu Yang 已提交
1995 1996 1997 1998 1999
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork14getLayerOutputERKNSt6stringE">
<span id="paddle::NeuralNetwork::getLayerOutput__ssCR"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a81f825afdf51f6de156325b311e283fc"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getLayerOutput</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>layerName</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork14getLayerOutputERKNSt6stringE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2000 2001
<dd></dd></dl>

Y
Yu Yang 已提交
2002 2003 2004
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork8getLayerERKNSt6stringE">
<span id="paddle::NeuralNetwork::getLayer__ssCR"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a9c1e19e9d52c918bdf175ec75c5bf854"></span><em class="property">const</em> LayerPtr &amp;<code class="descname">getLayer</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>layerName</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork8getLayerERKNSt6stringE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2005 2006
<dd></dd></dl>

Y
Yu Yang 已提交
2007 2008 2009 2010 2011 2012 2013 2014
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork9onPassEndEv">
<span id="paddle::NeuralNetwork::onPassEnd"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a827cd8004af4345e2afa1f4ac00eab81"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork9onPassEndEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork13makeEvaluatorEv">
<span id="paddle::NeuralNetwork::makeEvaluator"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a6b06dbf583d7c82068b29ab1a6001c59"></span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<code class="descname">makeEvaluator</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork13makeEvaluatorEv" title="Permalink to this definition"></a></dt>
2015
<dd><p>Create an evaluator which can be used for <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork_1aa465bf280a62ab7248fa6ec445be5086"><span class="std std-ref">eval()</span></a> </p>
Y
Yu Yang 已提交
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork4evalEP9Evaluator">
<span id="paddle::NeuralNetwork::eval__EvaluatorP"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1aa465bf280a62ab7248fa6ec445be5086"></span>void <code class="descname">eval</code><span class="sig-paren">(</span><a class="reference internal" href="../evaluators/evaluators.html#_CPPv2N6paddle9EvaluatorE" title="paddle::Evaluator">Evaluator</a> *<em>evaluator</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork4evalEP9Evaluator" title="Permalink to this definition"></a></dt>
<dd><p>evaluate using the given evaluator </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork10resetStateEv">
<span id="paddle::NeuralNetwork::resetState"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a1429e406b423066346e0aa33df8fc641"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork10resetStateEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork13setOutputGradERKNSt6vectorI8ArgumentEE">
<span id="paddle::NeuralNetwork::setOutputGrad__std::vector:Argument:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1ac28182c78950476b6e99dfd7f0d54b18"></span>void <code class="descname">setOutputGrad</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>args</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork13setOutputGradERKNSt6vectorI8ArgumentEE" title="Permalink to this definition"></a></dt>
<dd><p>Set the gradient of the output from outside. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork8setStateERK12MachineState">
<span id="paddle::NeuralNetwork::setState__MachineStateCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a33465ca66ec2e690739af0c1b489e97f"></span>void <code class="descname">setState</code><span class="sig-paren">(</span><em class="property">const</em> MachineState &amp;<em>machineState</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork8setStateERK12MachineState" title="Permalink to this definition"></a></dt>
<dd><p>set machine state </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork8getStateER12MachineState">
<span id="paddle::NeuralNetwork::getState__MachineStateR"></span>virtual <span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a81d8f19391605aa6eae21aa7e3f55432"></span>void <code class="descname">getState</code><span class="sig-paren">(</span>MachineState &amp;<em>machineState</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork8getStateER12MachineState" title="Permalink to this definition"></a></dt>
<dd><p>get machine state </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork15getParameterMapEv">
<span id="paddle::NeuralNetwork::getParameterMap"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1aaa69c65b242993a7fb0cf5b4a841f87a"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> *<code class="descname">getParameterMap</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork15getParameterMapEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
Y
Yu Yang 已提交
2053
<dt>
Y
Yu Yang 已提交
2054 2055 2056 2057
<em class="property">template </em>&lt;<em class="property">typename</em> T&gt;</dt>
<dt id="_CPPv2N6paddle13NeuralNetwork12forEachLayerE1T">
<span id="paddle::NeuralNetwork::forEachLayer__T"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a0069bd68db00a416d43c879beadbb26f"></span>void <code class="descname">forEachLayer</code><span class="sig-paren">(</span>T <em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork12forEachLayerE1T" title="Permalink to this definition"></a></dt>
<dd><p>Access each layer as a for each loop. </p>
Y
Yu Yang 已提交
2058 2059 2060
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
Y
Yu Yang 已提交
2061
<li><code class="first docutils literal"><span class="pre">callback</span></code> - <p>invoke with each layer. </p>
Y
Yu Yang 已提交
2062 2063 2064 2065 2066 2067 2068
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

Y
Yu Yang 已提交
2069 2070 2071 2072 2073 2074 2075
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork7connectE8LayerPtr8LayerPtri">
<span id="paddle::NeuralNetwork::connect__LayerPtr.LayerPtr.i"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a3fbee51002e5882ec516cfb5a837bb9d"></span>void <code class="descname">connect</code><span class="sig-paren">(</span>LayerPtr <em>agentLayer</em>, LayerPtr <em>realLayer</em>, int <em>height</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork7connectE8LayerPtr8LayerPtri" title="Permalink to this definition"></a></dt>
<dd><p>Connect two submodels and down-submodel&#8217;s output become up-submodel&#8217;s input. By default, connection is one by one, If the agent height is smaller than real layer, <em>height</em> has to be filled.</p>
Y
Yu Yang 已提交
2076 2077 2078
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
Y
Yu Yang 已提交
2079
<li><code class="first docutils literal"><span class="pre">realLayer</span></code> - <p>The down-submodel&#8217;s output layer. </p>
Y
Yu Yang 已提交
2080
</li>
Y
Yu Yang 已提交
2081
<li><code class="first docutils literal"><span class="pre">agentLayer</span></code> - <p>The up-submodel&#8217;s input agent layer. </p>
Y
Yu Yang 已提交
2082 2083 2084 2085 2086 2087 2088
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

Y
Yu Yang 已提交
2089 2090
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork6createERK11ModelConfig">
2091
<span id="paddle::NeuralNetwork::create__ModelConfigCR"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1ac9c74816576a78de8fe19f7d737a8e58"></span><a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork6createERK11ModelConfig" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2092 2093 2094 2095
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork16newNeuralNetworkERKNSt6stringEP13NeuralNetwork">
2096
<span id="paddle::NeuralNetwork::newNeuralNetwork__ssCR.NeuralNetworkP"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1af68b354d12fdfb4569d406f4c5565f16"></span><a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<code class="descname">newNeuralNetwork</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>name</em> = &quot;&quot;, <a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<em>rootNetwork</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork16newNeuralNetworkERKNSt6stringEP13NeuralNetwork" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2097 2098 2099 2100 2101 2102 2103 2104
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13NeuralNetwork13NeuralNetworkENSt6stringEP13NeuralNetwork">
<span id="paddle::NeuralNetwork::NeuralNetwork__ss.NeuralNetworkP"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a3594c9d7b8eb9d46ed1153fa36cb9999"></span><code class="descname">NeuralNetwork</code><span class="sig-paren">(</span>std::string <em>subModelName</em> = &quot;&quot;, <a class="reference internal" href="#_CPPv2N6paddle13NeuralNetwork13NeuralNetworkENSt6stringEP13NeuralNetwork" title="paddle::NeuralNetwork::NeuralNetwork">NeuralNetwork</a> *<em>rootNetwork</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork13NeuralNetworkENSt6stringEP13NeuralNetwork" title="Permalink to this definition"></a></dt>
2105
<dd><p>The constructor of <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork"><span class="std std-ref">NeuralNetwork</span></a>. The sub networks can get parameters_ and parameterMap_ from base <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork"><span class="std std-ref">NeuralNetwork</span></a>.</p>
Y
Yu Yang 已提交
2106 2107 2108
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
Y
Yu Yang 已提交
2109 2110 2111
<li><code class="first docutils literal"><span class="pre">subModelName</span></code> - <p>The name of sub-model. </p>
</li>
<li><code class="first docutils literal"><span class="pre">rootNetwork</span></code> - <p>It used in MultiNetwork. </p>
Y
Yu Yang 已提交
2112 2113 2114 2115 2116 2117 2118 2119 2120
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
Y
Yu Yang 已提交
2121 2122 2123 2124
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle13NeuralNetwork13subModelName_E">
<span id="paddle::NeuralNetwork::subModelName___ss"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a17a47ac7748b32f924f3817411ab17a9"></span>std::string <code class="descname">subModelName_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork13subModelName_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2125 2126
<dd></dd></dl>

Y
Yu Yang 已提交
2127 2128 2129
<dl class="member">
<dt id="_CPPv2N6paddle13NeuralNetwork7config_E">
<span id="paddle::NeuralNetwork::config___ModelConfig"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a658bd3ac8cd52a05c6441964d802438d"></span><a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> <code class="descname">config_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork7config_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2130 2131
<dd></dd></dl>

Y
Yu Yang 已提交
2132 2133 2134
<dl class="member">
<dt id="_CPPv2N6paddle13NeuralNetwork7layers_E">
<span id="paddle::NeuralNetwork::layers___std::vector:LayerPtr:"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1afe5052ef54d435dbcb66209e2dc64887"></span>std::vector&lt;LayerPtr&gt; <code class="descname">layers_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork7layers_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2135 2136 2137
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2138 2139
<dt id="_CPPv2N6paddle13NeuralNetwork13parameterMap_E">
<span id="paddle::NeuralNetwork::parameterMap___ParameterMap"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a6fea6befaa1b5136dd56e886cdc1cc70"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> <code class="descname">parameterMap_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork13parameterMap_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2140 2141 2142
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2143 2144
<dt id="_CPPv2N6paddle13NeuralNetwork9layerMap_E">
<span id="paddle::NeuralNetwork::layerMap___LayerMap"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a1a2c5d217dc4d9b8234213cf0e85e417"></span>LayerMap <code class="descname">layerMap_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork9layerMap_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2145 2146 2147
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2148 2149
<dt id="_CPPv2N6paddle13NeuralNetwork11dataLayers_E">
<span id="paddle::NeuralNetwork::dataLayers___std::vector:DataLayerPtr:"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1ae3f81909537d558232dc7dd8fc60ba01"></span>std::vector&lt;DataLayerPtr&gt; <code class="descname">dataLayers_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork11dataLayers_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2150 2151 2152
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2153 2154
<dt id="_CPPv2N6paddle13NeuralNetwork13outputLayers_E">
<span id="paddle::NeuralNetwork::outputLayers___std::vector:LayerPtr:"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a2738ad589b6189375c01c2db8c864cb1"></span>std::vector&lt;LayerPtr&gt; <code class="descname">outputLayers_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork13outputLayers_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2155 2156 2157
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2158
<dt id="_CPPv2N6paddle13NeuralNetwork12rootNetwork_E">
2159
<span id="paddle::NeuralNetwork::rootNetwork___NeuralNetworkP"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a17b253234b7cfe2d88cd02e0c31321c2"></span><a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<code class="descname">rootNetwork_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork12rootNetwork_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2160 2161 2162
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2163 2164 2165 2166
<dt id="_CPPv2N6paddle13NeuralNetwork16paramSelfInited_E">
<span id="paddle::NeuralNetwork::paramSelfInited___b"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1a8472011a458c099343bc29dfc82c9130"></span>bool <code class="descname">paramSelfInited_</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork16paramSelfInited_E" title="Permalink to this definition"></a></dt>
<dd><p>Whether parameter of this NN is initialized by its own (i.e., not by callback supplied with the caller) </p>
</dd></dl>
Y
Yu Yang 已提交
2167

Y
Yu Yang 已提交
2168 2169 2170
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Static Attributes</p>
Y
Yu Yang 已提交
2171
<dl class="member">
Y
Yu Yang 已提交
2172 2173
<dt id="_CPPv2N6paddle13NeuralNetwork10dllInitMapE">
<span id="paddle::NeuralNetwork::dllInitMap__std::map:ss.b:"></span><span class="target" id="paddleclasspaddle_1_1NeuralNetwork_1ab36f0382e07c7680e28171e84c0492ef"></span>std::map&lt;std::string, bool&gt; <code class="descname">dllInitMap</code><a class="headerlink" href="#_CPPv2N6paddle13NeuralNetwork10dllInitMapE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2174 2175 2176 2177 2178
<dd></dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
2179 2180 2181
</div>
<div class="section" id="parallelneuralnetwork">
<h2>ParallelNeuralNetwork<a class="headerlink" href="#parallelneuralnetwork" title="Permalink to this headline"></a></h2>
Y
Yu Yang 已提交
2182
<dl class="class">
Y
Yu Yang 已提交
2183 2184
<dt id="_CPPv2N6paddle21ParallelNeuralNetworkE">
<span id="paddle::ParallelNeuralNetwork"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ParallelNeuralNetwork</code><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetworkE" title="Permalink to this definition"></a></dt>
2185 2186
<dd><p>A <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork"><span class="std std-ref">ParallelNeuralNetwork</span></a> is capable of calculating a neural network through multiple threads in parallel. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1NeuralNetwork"><span class="std std-ref">paddle::NeuralNetwork</span></a></p>
Y
Yu Yang 已提交
2187
<div class="breathe-sectiondef container">
Y
Yu Yang 已提交
2188 2189
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
Y
Yu Yang 已提交
2190 2191
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork21ParallelNeuralNetworkENSt6stringEP13NeuralNetwork">
<span id="paddle::ParallelNeuralNetwork::ParallelNeuralNetwork__ss.NeuralNetworkP"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a460903e9523d1d33e5c20033aea323a5"></span><code class="descname">ParallelNeuralNetwork</code><span class="sig-paren">(</span>std::string <em>subModelName</em> = &quot;&quot;, <a class="reference internal" href="#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<em>rootNetwork</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork21ParallelNeuralNetworkENSt6stringEP13NeuralNetwork" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2192 2193
<dd></dd></dl>

Y
Yu Yang 已提交
2194 2195 2196
<dl class="function">
<dt>
virtual <span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a6927c23ac4ec4f8b2f1a3286edff118d"></span><code class="descname">void paddle::ParallelNeuralNetwork::init(const  ModelConfig  &amp; config, ParamInitCallback callback = nullptr, const std::vector&lt; ParameterType &gt; &amp; parameterTypes = std::vector&lt; ParameterType &gt;{PARAMETER_VALUE, PARAMETER_GRADIENT, PARAMETER_MOMENTUM}, bool useGpu = FLAGS_use_gpu)</code></dt>
Y
Yu Yang 已提交
2197 2198
<dd></dd></dl>

Y
Yu Yang 已提交
2199 2200 2201 2202 2203 2204 2205
<dl class="function">
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType">
<span id="paddle::ParallelNeuralNetwork::forward__std::vector:Argument:CR.std::vector:Argument:P.PassType"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1abc398ee055d6aaef479a1b082fc70634"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork7forwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassType" title="Permalink to this definition"></a></dt>
<dd><p>Forward propagation. </p>
<p>Calculate outputs (outArgs) based the inputs (inArgs)</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
2206
<dd>: if passType==PASS_TEST, then <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1a9305ac4bc0e86e7957e842612caca2f0"><span class="std std-ref">backward()</span></a> should not be called </dd>
Y
Yu Yang 已提交
2207 2208 2209
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2210

Y
Yu Yang 已提交
2211 2212 2213 2214 2215
<dl class="function">
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork8backwardERK14UpdateCallback">
<span id="paddle::ParallelNeuralNetwork::backward__UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a9305ac4bc0e86e7957e842612caca2f0"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork8backwardERK14UpdateCallback" title="Permalink to this definition"></a></dt>
<dd><p>Backward propagation. </p>
<p>Calculate the gradient of inArgs and parameter.</p>
2216 2217
<p>This function should only be called after a corresponding <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1abc398ee055d6aaef479a1b082fc70634"><span class="std std-ref">forward()</span></a> call. The caller is responsible for filling the correct grad for the outArgs obtained using <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1abc398ee055d6aaef479a1b082fc70634"><span class="std std-ref">forward()</span></a>.</p>
<p>It may also change the grad field for the inArgs supplied at <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1abc398ee055d6aaef479a1b082fc70634"><span class="std std-ref">forward()</span></a> </p>
Y
Yu Yang 已提交
2218 2219 2220
</dd></dl>

<dl class="function">
Y
Yu Yang 已提交
2221 2222
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback">
<span id="paddle::ParallelNeuralNetwork::forwardBackward__std::vector:Argument:CR.std::vector:Argument:P.PassType.UpdateCallbackCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a4716fcdde3a480e07edd7ee867556fb5"></span>void <code class="descname">forwardBackward</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; &amp;<em>inArgs</em>, std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; *<em>outArgs</em>, PassType <em>passType</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = NULL<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork15forwardBackwardERKNSt6vectorI8ArgumentEEPNSt6vectorI8ArgumentEE8PassTypeRK14UpdateCallback" title="Permalink to this definition"></a></dt>
2223
<dd><p>Combine <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1abc398ee055d6aaef479a1b082fc70634"><span class="std std-ref">forward()</span></a> and <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1a9305ac4bc0e86e7957e842612caca2f0"><span class="std std-ref">backward()</span></a>. For multithread training, this may be faster.</p>
Y
Yu Yang 已提交
2224 2225
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
2226
<dd>: passType PASS_TEST is not allowed for <a class="reference internal" href="#paddleclasspaddle_1_1ParallelNeuralNetwork_1a4716fcdde3a480e07edd7ee867556fb5"><span class="std std-ref">forwardBackward()</span></a>. </dd>
Y
Yu Yang 已提交
2227 2228 2229
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2230 2231

<dl class="function">
Y
Yu Yang 已提交
2232 2233 2234 2235 2236 2237 2238 2239
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork5startERK13TrainerConfig15DataProviderPtr">
<span id="paddle::ParallelNeuralNetwork::start__TrainerConfigCR.DataProviderPtr"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1acace0c49d8574906759e6ca091f5bf15"></span>void <code class="descname">start</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv213TrainerConfig" title="TrainerConfig">TrainerConfig</a> &amp;<em>config</em>, DataProviderPtr <em>dataProvider</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork5startERK13TrainerConfig15DataProviderPtr" title="Permalink to this definition"></a></dt>
<dd><p>Used before formal training, start work-threads and set trainer Parameters;. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This function will only been implemented and used in a multithreaded environment. </dd>
</dl>
</p>
Y
Yu Yang 已提交
2240 2241 2242
</dd></dl>

<dl class="function">
Y
Yu Yang 已提交
2243 2244
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork16addComputeThreadEi">
<span id="paddle::ParallelNeuralNetwork::addComputeThread__i"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1abbd07b98c8f7348263faa061f741a7ee"></span>void <code class="descname">addComputeThread</code><span class="sig-paren">(</span>int <em>deviceId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork16addComputeThreadEi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2245 2246 2247
<dd></dd></dl>

<dl class="function">
Y
Yu Yang 已提交
2248 2249 2250
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork18dispatchByDeviceIdEi8LayerPtr8TaskType">
<span id="paddle::ParallelNeuralNetwork::dispatchByDeviceId__i.LayerPtr.TaskType"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a2a662ce2df8818caab9ec4cde5e8c820"></span>void <code class="descname">dispatchByDeviceId</code><span class="sig-paren">(</span>int <em>deviceId</em>, LayerPtr <em>layer</em>, TaskType <em>task</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork18dispatchByDeviceIdEi8LayerPtr8TaskType" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
2251 2252

<dl class="function">
Y
Yu Yang 已提交
2253 2254 2255
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork13waitAllThreadEv">
<span id="paddle::ParallelNeuralNetwork::waitAllThread"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a6c19ec9f1b56110749f107721016fee7"></span>void <code class="descname">waitAllThread</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork13waitAllThreadEv" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
2256 2257 2258 2259 2260

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
Y
Yu Yang 已提交
2261 2262
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork7useGpu_E">
<span id="paddle::ParallelNeuralNetwork::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a565a32be9bf77a56fc7365148e353241"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork7useGpu_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2263 2264 2265
<dd></dd></dl>

<dl class="member">
Y
Yu Yang 已提交
2266 2267 2268 2269 2270 2271 2272 2273
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork11numDevices_E">
<span id="paddle::ParallelNeuralNetwork::numDevices___i"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1a05d8d2f18dd4c0b20d89815cebe84b62"></span>int <code class="descname">numDevices_</code><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork11numDevices_E" title="Permalink to this definition"></a></dt>
<dd><p>number of gpu devices </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle21ParallelNeuralNetwork8threads_E">
<span id="paddle::ParallelNeuralNetwork::threads___std::vector:std::unique_ptr:ParallelThread::"></span><span class="target" id="paddleclasspaddle_1_1ParallelNeuralNetwork_1ad7e42280caee2816aff97b386048c288"></span>std::vector&lt;std::unique_ptr&lt;ParallelThread&gt;&gt; <code class="descname">threads_</code><a class="headerlink" href="#_CPPv2N6paddle21ParallelNeuralNetwork8threads_E" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../../index.html">Table Of Contents</a></h3>
  <ul>
Y
Yu Yang 已提交
2290 2291 2292 2293 2294 2295 2296
<li><a class="reference internal" href="#">Gradient Machines</a><ul>
<li><a class="reference internal" href="#gradientmachine">GradientMachine</a></li>
<li><a class="reference internal" href="#gradientmachinemodel">GradientMachineModel</a></li>
<li><a class="reference internal" href="#multigradientmachine">MultiGradientMachine</a><ul>
<li><a class="reference internal" href="#trainerthread">TrainerThread</a></li>
</ul>
</li>
Y
Yu Yang 已提交
2297 2298 2299
<li><a class="reference internal" href="#recurrent-gradient-machines">Recurrent Gradient Machines</a></li>
</ul>
</li>
Y
Yu Yang 已提交
2300 2301 2302 2303 2304
<li><a class="reference internal" href="#networks">Networks</a><ul>
<li><a class="reference internal" href="#neuralnetwork">NeuralNetwork</a></li>
<li><a class="reference internal" href="#parallelneuralnetwork">ParallelNeuralNetwork</a></li>
</ul>
</li>
Y
Yu Yang 已提交
2305 2306 2307 2308 2309 2310
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Gradient Machines Documents</a></p>
  <h4>Next topic</h4>
Y
Yu Yang 已提交
2311 2312
  <p class="topless"><a href="../../math/matrix/index.html"
                        title="next chapter">Matrix Documents</a></p>
Y
Yu Yang 已提交
2313 2314 2315 2316 2317 2318 2319 2320 2321 2322
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/source/gserver/gradientmachines/gradientmachines.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../../../search.html" method="get">
2323 2324
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
Y
Yu Yang 已提交
2344
          <a href="../../math/matrix/index.html" title="Matrix Documents"
Y
Yu Yang 已提交
2345 2346 2347 2348
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Gradient Machines Documents"
             >previous</a> |</li>
2349 2350 2351
        <li class="nav-item nav-item-0"><a href="../../../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >Source Code Documents</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Gradient Machines Documents</a> &#187;</li> 
Y
Yu Yang 已提交
2352 2353 2354
      </ul>
    </div>
    <div class="footer" role="contentinfo">
2355 2356
        &#169; Copyright 2016, PaddlePaddle developers.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.6.
Y
Yu Yang 已提交
2357 2358 2359
    </div>
  </body>
</html>