rnn.html 141.1 KB
Newer Older
1 2


Y
Yu Yang 已提交
3 4 5 6 7 8 9 10
<!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" />
    
11
    <title>Neural Networks &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
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>
29 30
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
Y
Yu Yang 已提交
31 32 33 34
    <link rel="top" title="PaddlePaddle  documentation" href="../../../index.html" />
    <link rel="up" title="RNN" href="index.html" />
    <link rel="next" title="Utils" href="../utils/index.html" />
    <link rel="prev" title="RNN" href="index.html" /> 
35 36 37 38 39 40 41 42 43 44
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?b9a314ab40d04d805655aab1deee08ba";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

Y
Yu Yang 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
  </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" >
          <a href="../utils/index.html" title="Utils"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="RNN"
             accesskey="P">previous</a> |</li>
62 63 64
        <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">RNN</a> &#187;</li> 
Y
Yu Yang 已提交
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="neural-networks">
<h1>Neural Networks<a class="headerlink" href="#neural-networks" title="Permalink to this headline"></a></h1>
<div class="section" id="base">
<h2>Base<a class="headerlink" href="#base" title="Permalink to this headline"></a></h2>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv221hl_shrink_col2featurePK4real6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_tP4real4real4real">
<span id="hl_shrink_col2feature__realCP.s.s.s.s.s.s.s.s.s.s.s.realP.real.real"></span><span class="target" id="paddlehl__cnn_8h_1a0c203a19e471a162989ce8798d398e5c"></span>void <code class="descname">hl_shrink_col2feature</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>dataCol</em>, size_t <em>channels</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>blockH</em>, size_t <em>blockW</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real *<em>dataIm</em>, real <em>alpha</em> = 1.0f, real <em>beta</em> = 0.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv221hl_shrink_col2featurePK4real6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_tP4real4real4real" title="Permalink to this definition"></a></dt>
<dd><p>Shrink column to feature. </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">dataCol</span></code> - <p>expand data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">blockH</span></code> - <p>filter height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">blockW</span></code> - <p>filter width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">strideH</span></code> - <p>stride height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">strideW</span></code> - <p>stride width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingH</span></code> - <p>padding height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingW</span></code> - <p>padding width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputH</span></code> - <p>output height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputW</span></code> - <p>output width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">dataIm</span></code> - <p>output image data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">alpha</span></code> - <p></p>
</li>
<li><code class="first docutils literal"><span class="pre">beta</span></code> - <p></p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv221hl_expand_feature2colPK4real6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_tP4real">
<span id="hl_expand_feature2col__realCP.s.s.s.s.s.s.s.s.s.s.s.realP"></span><span class="target" id="paddlehl__cnn_8h_1a1e99cd0e40ae75f98ea606428c8bbc79"></span>void <code class="descname">hl_expand_feature2col</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>dataIm</em>, size_t <em>channels</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>blockH</em>, size_t <em>blockW</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real *<em>dataCol</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv221hl_expand_feature2colPK4real6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_tP4real" title="Permalink to this definition"></a></dt>
<dd><p>Expand feature to column. </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">dataIm</span></code> - <p>input image data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">blockH</span></code> - <p>filter height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">blockW</span></code> - <p>filter width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">strideH</span></code> - <p>stride height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">strideW</span></code> - <p>stride width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingH</span></code> - <p>padding height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingW</span></code> - <p>padding width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputH</span></code> - <p>output height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputW</span></code> - <p>output width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">dataCol</span></code> - <p>expand data. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
162 163
<dt id="_CPPv218hl_maxpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4real">
<span id="hl_maxpool_forward__iC.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.realP"></span><span class="target" id="paddlehl__cnn_8h_1a8059e00019ba687c3e1b51b2fe6abfdf"></span>void <code class="descname">hl_maxpool_forward</code><span class="sig-paren">(</span><em class="property">const</em> int <em>frameCnt</em>, <em class="property">const</em> real *<em>inputData</em>, <em class="property">const</em> int <em>channels</em>, <em class="property">const</em> int <em>height</em>, <em class="property">const</em> int <em>width</em>, <em class="property">const</em> int <em>pooledH</em>, <em class="property">const</em> int <em>pooledW</em>, <em class="property">const</em> int <em>sizeX</em>, <em class="property">const</em> int <em>sizeY</em>, <em class="property">const</em> int <em>strideH</em>, <em class="property">const</em> int <em>strideW</em>, <em class="property">const</em> int <em>paddingH</em>, <em class="property">const</em> int <em>paddingW</em>, real *<em>tgtData</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_maxpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4real" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
<dd><p>Maximum pool forward. </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">frameCnt</span></code> - <p>batch size of input image. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputData</span></code> - <p>input data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledH</span></code> - <p>output image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledW</span></code> - <p>output image width. </p>
</li>
182
<li><code class="first docutils literal"><span class="pre">sizeX</span></code> - <p>width of pooling window. </p>
Y
Yu Yang 已提交
183
</li>
184
<li><code class="first docutils literal"><span class="pre">sizeY</span></code> - <p>height of pooling window. </p>
Y
Yu Yang 已提交
185
</li>
186 187 188 189 190 191 192
<li><code class="first docutils literal"><span class="pre">strideH</span></code> - <p>pooling stride height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">strideW</span></code> - <p>pooling stride width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingH</span></code> - <p>padding height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingW</span></code> - <p>padding width. </p>
Y
Yu Yang 已提交
193 194 195 196 197 198 199 200 201 202
</li>
<li><code class="first docutils literal"><span class="pre">tgtData</span></code> - <p>output data. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
203 204
<dt id="_CPPv219hl_maxpool_backwardKiPK4realPK4realPK4realKiKiKiKiKiKiKiKiKiKiKi4real4realP4real">
<span id="hl_maxpool_backward__iC.realCP.realCP.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.real.real.realP"></span><span class="target" id="paddlehl__cnn_8h_1a5a5671e0aadc4d58addb2f6c81f5c26b"></span>void <code class="descname">hl_maxpool_backward</code><span class="sig-paren">(</span><em class="property">const</em> int <em>frameCnt</em>, <em class="property">const</em> real *<em>inputData</em>, <em class="property">const</em> real *<em>outData</em>, <em class="property">const</em> real *<em>outGrad</em>, <em class="property">const</em> int <em>channels</em>, <em class="property">const</em> int <em>height</em>, <em class="property">const</em> int <em>width</em>, <em class="property">const</em> int <em>pooledH</em>, <em class="property">const</em> int <em>pooledW</em>, <em class="property">const</em> int <em>sizeX</em>, <em class="property">const</em> int <em>sizeY</em>, <em class="property">const</em> int <em>strideH</em>, <em class="property">const</em> int <em>strideW</em>, <em class="property">const</em> int <em>paddingH</em>, <em class="property">const</em> int <em>paddingW</em>, real <em>scaleA</em>, real <em>scaleB</em>, real *<em>targetGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_maxpool_backwardKiPK4realPK4realPK4realKiKiKiKiKiKiKiKiKiKiKi4real4realP4real" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
<dd><p>Maximum pool backward. </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">frameCnt</span></code> - <p>batch size of input image. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputData</span></code> - <p>input data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outData</span></code> - <p>output data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outGrad</span></code> - <p>output grad data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledH</span></code> - <p>output image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledW</span></code> - <p>output image width. </p>
</li>
227
<li><code class="first docutils literal"><span class="pre">sizeX</span></code> - <p>width of pooling window. </p>
Y
Yu Yang 已提交
228
</li>
229
<li><code class="first docutils literal"><span class="pre">sizeY</span></code> - <p>height of pooling window. </p>
Y
Yu Yang 已提交
230
</li>
231
<li><code class="first docutils literal"><span class="pre">strideH</span></code> - <p>pooling stride height. </p>
Y
Yu Yang 已提交
232
</li>
233
<li><code class="first docutils literal"><span class="pre">strideW</span></code> - <p>pooling stride width. </p>
Y
Yu Yang 已提交
234 235 236 237 238
</li>
<li><code class="first docutils literal"><span class="pre">scaleA</span></code> - <p>scale. </p>
</li>
<li><code class="first docutils literal"><span class="pre">scaleB</span></code> - <p>scale. </p>
</li>
239 240 241 242 243 244
<li><code class="first docutils literal"><span class="pre">paddingH</span></code> - <p>padding height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingW</span></code> - <p>padding width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">targetGrad</span></code> - <p>output grad. </p>
</li>
Y
Yu Yang 已提交
245 246 247 248 249 250 251
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
252 253
<dt id="_CPPv218hl_avgpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4real">
<span id="hl_avgpool_forward__iC.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.realP"></span><span class="target" id="paddlehl__cnn_8h_1a85120743584a4241217d60b83a61a894"></span>void <code class="descname">hl_avgpool_forward</code><span class="sig-paren">(</span><em class="property">const</em> int <em>frameCnt</em>, <em class="property">const</em> real *<em>inputData</em>, <em class="property">const</em> int <em>channels</em>, <em class="property">const</em> int <em>height</em>, <em class="property">const</em> int <em>width</em>, <em class="property">const</em> int <em>pooledH</em>, <em class="property">const</em> int <em>pooledW</em>, <em class="property">const</em> int <em>sizeX</em>, <em class="property">const</em> int <em>sizeY</em>, <em class="property">const</em> int <em>strideH</em>, <em class="property">const</em> int <em>strideW</em>, <em class="property">const</em> int <em>paddingH</em>, <em class="property">const</em> int <em>paddingW</em>, real *<em>tgtData</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_avgpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4real" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271
<dd><p>Averge pool forward. </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">frameCnt</span></code> - <p>batch size of input image. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputData</span></code> - <p>input data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledH</span></code> - <p>output image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledW</span></code> - <p>output image width. </p>
</li>
272
<li><code class="first docutils literal"><span class="pre">sizeX</span></code> - <p>width of pooling window. </p>
Y
Yu Yang 已提交
273
</li>
274
<li><code class="first docutils literal"><span class="pre">sizeY</span></code> - <p>height of pooling window. </p>
Y
Yu Yang 已提交
275
</li>
276 277 278 279 280 281 282
<li><code class="first docutils literal"><span class="pre">strideH</span></code> - <p>pooling stride height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">strideW</span></code> - <p>pooling stride width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingH</span></code> - <p>padding height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingW</span></code> - <p>padding width. </p>
Y
Yu Yang 已提交
283 284 285 286 287 288 289 290 291 292
</li>
<li><code class="first docutils literal"><span class="pre">tgtData</span></code> - <p>output data. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
293 294
<dt id="_CPPv219hl_avgpool_backwardKiPK4realKiKiKiKiKiKiKiKiKiii4real4realP4real">
<span id="hl_avgpool_backward__iC.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.i.i.real.real.realP"></span><span class="target" id="paddlehl__cnn_8h_1adb3a661e90396ffbf2602ad317d95a8c"></span>void <code class="descname">hl_avgpool_backward</code><span class="sig-paren">(</span><em class="property">const</em> int <em>frameCnt</em>, <em class="property">const</em> real *<em>outGrad</em>, <em class="property">const</em> int <em>channels</em>, <em class="property">const</em> int <em>height</em>, <em class="property">const</em> int <em>width</em>, <em class="property">const</em> int <em>pooledH</em>, <em class="property">const</em> int <em>pooledW</em>, <em class="property">const</em> int <em>sizeX</em>, <em class="property">const</em> int <em>sizeY</em>, <em class="property">const</em> int <em>strideH</em>, <em class="property">const</em> int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, real <em>scaleA</em>, real <em>scaleB</em>, real *<em>backGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_avgpool_backwardKiPK4realKiKiKiKiKiKiKiKiKiii4real4realP4real" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
295 296 297 298 299 300
<dd><p>Maximum pool backward. </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">frameCnt</span></code> - <p>batch size of input image. </p>
</li>
301
<li><code class="first docutils literal"><span class="pre">outGrad</span></code> - <p>output grad data. </p>
Y
Yu Yang 已提交
302 303 304 305 306 307 308 309 310 311 312
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledH</span></code> - <p>output image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">pooledW</span></code> - <p>output image width. </p>
</li>
313
<li><code class="first docutils literal"><span class="pre">sizeX</span></code> - <p>width of pooling window. </p>
Y
Yu Yang 已提交
314
</li>
315
<li><code class="first docutils literal"><span class="pre">sizeY</span></code> - <p>height of pooling window. </p>
Y
Yu Yang 已提交
316
</li>
317
<li><code class="first docutils literal"><span class="pre">strideH</span></code> - <p>pooling stride height. </p>
Y
Yu Yang 已提交
318
</li>
319 320 321 322 323
<li><code class="first docutils literal"><span class="pre">strideW</span></code> - <p>pooling stride width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingH</span></code> - <p>padding height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">paddingW</span></code> - <p>padding width. </p>
Y
Yu Yang 已提交
324 325 326 327 328
</li>
<li><code class="first docutils literal"><span class="pre">scaleA</span></code> - <p>scale. </p>
</li>
<li><code class="first docutils literal"><span class="pre">scaleB</span></code> - <p>scale. </p>
</li>
329 330
<li><code class="first docutils literal"><span class="pre">backGrad</span></code> - <p>output grad. </p>
</li>
Y
Yu Yang 已提交
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv218hl_CMRNorm_forward6size_tPK4realP4realP4real6size_t6size_t6size_t6size_t4real4real">
<span id="hl_CMRNorm_forward__s.realCP.realP.realP.s.s.s.s.real.real"></span><span class="target" id="paddlehl__cnn_8h_1afd9a2bc745c54a20ca7b4cc9e5988f90"></span>void <code class="descname">hl_CMRNorm_forward</code><span class="sig-paren">(</span>size_t <em>frameCnt</em>, <em class="property">const</em> real *<em>in</em>, real *<em>scale</em>, real *<em>out</em>, size_t <em>channels</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>sizeX</em>, real <em>alpha</em>, real <em>beta</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_CMRNorm_forward6size_tPK4realP4realP4real6size_t6size_t6size_t6size_t4real4real" title="Permalink to this definition"></a></dt>
<dd><p>Cross-map-respose normalize forward. </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">frameCnt</span></code> - <p>batch size of input image. </p>
</li>
<li><code class="first docutils literal"><span class="pre">in</span></code> - <p>input data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">scale</span></code> - <p>buffer. </p>
</li>
<li><code class="first docutils literal"><span class="pre">out</span></code> - <p>output data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sizeX</span></code> - <p>size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">alpha</span></code> - <p>scale. </p>
</li>
<li><code class="first docutils literal"><span class="pre">beta</span></code> - <p>scale. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv219hl_CMRNorm_backward6size_tPK4realPK4realPK4realPK4realP4real6size_t6size_t6size_t6size_t4real4real">
<span id="hl_CMRNorm_backward__s.realCP.realCP.realCP.realCP.realP.s.s.s.s.real.real"></span><span class="target" id="paddlehl__cnn_8h_1ad19e0cb99876c92726144f707032ea46"></span>void <code class="descname">hl_CMRNorm_backward</code><span class="sig-paren">(</span>size_t <em>frameCnt</em>, <em class="property">const</em> real *<em>inV</em>, <em class="property">const</em> real *<em>scale</em>, <em class="property">const</em> real *<em>outV</em>, <em class="property">const</em> real *<em>outDiff</em>, real *<em>inDiff</em>, size_t <em>channels</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>sizeX</em>, real <em>alpha</em>, real <em>beta</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_CMRNorm_backward6size_tPK4realPK4realPK4realPK4realP4real6size_t6size_t6size_t6size_t4real4real" title="Permalink to this definition"></a></dt>
<dd><p>Cross-map-respose normalize backward. </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">frameCnt</span></code> - <p>batch size of input image. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inV</span></code> - <p>input data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">scale</span></code> - <p>buffer. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outV</span></code> - <p>output value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outDiff</span></code> - <p>output grad. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inDiff</span></code> - <p>input grad. </p>
</li>
<li><code class="first docutils literal"><span class="pre">channels</span></code> - <p>number of channel. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>image height. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sizeX</span></code> - <p>size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">alpha</span></code> - <p>scale. </p>
</li>
<li><code class="first docutils literal"><span class="pre">beta</span></code> - <p>scale. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 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
<dl class="function">
<dt id="_CPPv217hl_maxout_forwardPK4realP4realPi6size_t6size_t6size_t6size_t">
<span id="hl_maxout_forward__realCP.realP.iP.s.s.s.s"></span><span class="target" id="paddlehl__cnn_8h_1a194fd1a9bed05cb00bf7bf59b649b053"></span>void <code class="descname">hl_maxout_forward</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>inData</em>, real *<em>outData</em>, int *<em>idData</em>, size_t <em>batchSize</em>, size_t <em>size</em>, size_t <em>featLen</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv217hl_maxout_forwardPK4realP4realPi6size_t6size_t6size_t6size_t" title="Permalink to this definition"></a></dt>
<dd><p>MaxOut forward. </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">inData</span></code> - <p>input data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outData</span></code> - <p>output data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">idData</span></code> - <p>output maxId. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>batchSize. </p>
</li>
<li><code class="first docutils literal"><span class="pre">size</span></code> - <p>number of channels * image height * image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">featLen</span></code> - <p>feature length = image height * image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">groups</span></code> - <p>number of groups. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv218hl_maxout_backwardP4realPK4realPKi6size_t6size_t6size_t6size_t">
<span id="hl_maxout_backward__realP.realCP.iCP.s.s.s.s"></span><span class="target" id="paddlehl__cnn_8h_1a258d5fbc3c34047d5dc6ac068e81730e"></span>void <code class="descname">hl_maxout_backward</code><span class="sig-paren">(</span>real *<em>inGrad</em>, <em class="property">const</em> real *<em>outGrad</em>, <em class="property">const</em> int *<em>idData</em>, size_t <em>batchSize</em>, size_t <em>size</em>, size_t <em>featLen</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_maxout_backwardP4realPK4realPKi6size_t6size_t6size_t6size_t" title="Permalink to this definition"></a></dt>
<dd><p>MaxOut backward. </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">inGrad</span></code> - <p>input grad data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outGrad</span></code> - <p>output grad data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">idData</span></code> - <p>output maxId. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>batchSize. </p>
</li>
<li><code class="first docutils literal"><span class="pre">size</span></code> - <p>number of channels * image height * image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">featLen</span></code> - <p>feature length = image height * image width. </p>
</li>
<li><code class="first docutils literal"><span class="pre">groups</span></code> - <p>number of groups. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

Y
Yu Yang 已提交
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.SIGMOID_THRESHOLD_MIN">
<span class="target" id="paddlehl__functions_8h_1a8d1f4d3c4fc806e1ef3c9626ecdaf0e5"></span><code class="descname">SIGMOID_THRESHOLD_MIN</code><a class="headerlink" href="#c.SIGMOID_THRESHOLD_MIN" title="Permalink to this definition"></a></dt>
<dd><p>sigmoid threshold maximum </p>
</dd></dl>

<dl class="macro">
<dt id="c.SIGMOID_THRESHOLD_MAX">
<span class="target" id="paddlehl__functions_8h_1a7159c42ec9c6c55dd04a04e90a230d10"></span><code class="descname">SIGMOID_THRESHOLD_MAX</code><a class="headerlink" href="#c.SIGMOID_THRESHOLD_MAX" title="Permalink to this definition"></a></dt>
<dd><p>sigmoid threshold minimum </p>
</dd></dl>

</div>
<dl class="type">
<dt id="_CPPv24hppl">
<span id="hppl"></span><span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code><a class="headerlink" href="#_CPPv24hppl" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv2N4hppl4reluEK4real">
<span id="hppl::relu__realC"></span><span class="target" id="paddlenamespacehppl_1ab484790b12dd8438fc5aa4ecf53e4cb8"></span>real <code class="descname">relu</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4reluEK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl7sigmoidEK4real">
<span id="hppl::sigmoid__realC"></span><span class="target" id="paddlenamespacehppl_1ae0e45815e071558f9c7f4ca28a1e51fe"></span>real <code class="descname">sigmoid</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl7sigmoidEK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl4tanhEK4real">
<span id="hppl::tanh__realC"></span><span class="target" id="paddlenamespacehppl_1a65bbdf55e34ecc758ecc02deee1b0a08"></span>real <code class="descname">tanh</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4tanhEK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl6linearEK4real">
<span id="hppl::linear__realC"></span><span class="target" id="paddlenamespacehppl_1a958b779479dbab8594fd637d1ca095d2"></span>real <code class="descname">linear</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl6linearEK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl4reluEK4realK4real">
<span id="hppl::relu__realC.realC"></span><span class="target" id="paddlenamespacehppl_1a5c4661516a4faaf830e5c696a0f8ce01"></span>real <code class="descname">relu</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em>, <em class="property">const</em> real <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4reluEK4realK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl7sigmoidEK4realK4real">
<span id="hppl::sigmoid__realC.realC"></span><span class="target" id="paddlenamespacehppl_1a59190951a29364efa072a73f1d5eecbc"></span>real <code class="descname">sigmoid</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em>, <em class="property">const</em> real <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl7sigmoidEK4realK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl4tanhEK4realK4real">
<span id="hppl::tanh__realC.realC"></span><span class="target" id="paddlenamespacehppl_1a24b2c91476924b04f9004be255c18f20"></span>real <code class="descname">tanh</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em>, <em class="property">const</em> real <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4tanhEK4realK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl6linearEK4realK4real">
<span id="hppl::linear__realC.realC"></span><span class="target" id="paddlenamespacehppl_1a0e4a56b4983b6b28ce07fcf95ec34048"></span>real <code class="descname">linear</code><span class="sig-paren">(</span><em class="property">const</em> real <em>a</em>, <em class="property">const</em> real <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl6linearEK4realK4real" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

<dl class="type">
<dt id="_CPPv24hppl">
527
<span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code><a class="headerlink" href="#_CPPv24hppl" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 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 571 572
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv2N4hppl4reluEK6__m256">
<span id="hppl::relu____m256C"></span><span class="target" id="paddlenamespacehppl_1a83da095c31370cac641a5be6d9c6bf69"></span>__m256 <code class="descname">relu</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4reluEK6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl7sigmoidEK6__m256">
<span id="hppl::sigmoid____m256C"></span><span class="target" id="paddlenamespacehppl_1a1b1b2a0b499e70d617a61cd67295f348"></span>__m256 <code class="descname">sigmoid</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl7sigmoidEK6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl4tanhEK6__m256">
<span id="hppl::tanh____m256C"></span><span class="target" id="paddlenamespacehppl_1a923ccde586dccaaad5bf00d17ca82dc7"></span>__m256 <code class="descname">tanh</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4tanhEK6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl6linearEK6__m256">
<span id="hppl::linear____m256C"></span><span class="target" id="paddlenamespacehppl_1a6d682d3d73a248ca67845c9b69e0b5dc"></span>__m256 <code class="descname">linear</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl6linearEK6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl4reluEK6__m256K6__m256">
<span id="hppl::relu____m256C.__m256C"></span><span class="target" id="paddlenamespacehppl_1a658b2205ad6fd2ee2127f5d439727323"></span>__m256 <code class="descname">relu</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em>, <em class="property">const</em> __m256 <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4reluEK6__m256K6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl7sigmoidEK6__m256K6__m256">
<span id="hppl::sigmoid____m256C.__m256C"></span><span class="target" id="paddlenamespacehppl_1a73a594c90d9c2fe736a974a7d0fe6794"></span>__m256 <code class="descname">sigmoid</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em>, <em class="property">const</em> __m256 <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl7sigmoidEK6__m256K6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl4tanhEK6__m256K6__m256">
<span id="hppl::tanh____m256C.__m256C"></span><span class="target" id="paddlenamespacehppl_1a892d83522dee2b35ee753c316f267712"></span>__m256 <code class="descname">tanh</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em>, <em class="property">const</em> __m256 <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl4tanhEK6__m256K6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N4hppl6linearEK6__m256K6__m256">
<span id="hppl::linear____m256C.__m256C"></span><span class="target" id="paddlenamespacehppl_1adf41f0378e87a43f4f3c04ad813de75e"></span>__m256 <code class="descname">linear</code><span class="sig-paren">(</span><em class="property">const</em> __m256 <em>a</em>, <em class="property">const</em> __m256 <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N4hppl6linearEK6__m256K6__m256" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

573 574 575 576 577 578 579 580 581
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_DEVICE_FUNCTIONS_CUH_">
<span class="target" id="paddlehl__device__functions_8cuh_1ae9c51a8d7930ee22cbacdc403c0e3d76"></span><code class="descname">HL_DEVICE_FUNCTIONS_CUH_</code><a class="headerlink" href="#c.HL_DEVICE_FUNCTIONS_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<dl class="type">
582 583
<dt id="_CPPv26paddle">
<span id="paddle"></span><span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code><a class="headerlink" href="#_CPPv26paddle" title="Permalink to this definition"></a></dt>
584 585 586 587
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt>
<span class="target" id="paddlenamespacepaddle_1abcad9a84d03d6d95c6f95c2374c507f1"></span><code class="descname">__device__ T paddle::paddleAtomicAdd(T * address, T val)</code></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddlenamespacepaddle_1a13d9db60a2cb630b48e01dc46334ae9c"></span><code class="descname">__device__ float paddle::paddleAtomicAdd(float * address, float val)</code></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddlenamespacepaddle_1a7cc9b9f8e1a0ea1ff5d017d341551041"></span><code class="descname">__device__ double paddle::paddleAtomicAdd(double * address, double val)</code></dt>
605 606 607 608 609 610 611 612 613 614 615 616 617
<dd></dd></dl>

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

<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_GPU_FUNCTIONS_CUH_">
<span class="target" id="paddlehl__gpu__functions_8cuh_1a97e92037f3458f78e027975ff6ede206"></span><code class="descname">HL_GPU_FUNCTIONS_CUH_</code><a class="headerlink" href="#c.HL_GPU_FUNCTIONS_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
Y
Yu Yang 已提交
618 619 620 621 622 623 624 625 626 627 628 629 630
</div>
<div class="section" id="activation-functions">
<h2>Activation Functions<a class="headerlink" href="#activation-functions" title="Permalink to this headline"></a></h2>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HPPL_ACTIVE_FUNCTION">
<span class="target" id="paddlehl__activation__functions_8h_1a45d2908a6b0fcfd894767fa2f360e4be"></span><code class="descname">HPPL_ACTIVE_FUNCTION</code><a class="headerlink" href="#c.HPPL_ACTIVE_FUNCTION" title="Permalink to this definition"></a></dt>
<dd><p>Active functions: sigmoid, relu, tanh and linear. </p>
</dd></dl>

</div>
<dl class="type">
631 632
<dt>
<span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code></dt>
Y
Yu Yang 已提交
633 634 635 636 637 638 639 640 641
<dd><dl class="class">
<dt>
<span class="target" id="paddleclasshppl_1_1Active"></span><em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N4hppl6ActiveE">
<span id="hppl::Active"></span><em class="property">class </em><code class="descname">Active</code><a class="headerlink" href="#_CPPv2N4hppl6ActiveE" title="Permalink to this definition"></a></dt>
<dd><em>#include &lt;hl_activation_functions.h&gt;</em><p>Hppl supports sigmoid, relu, tanh, linear active functions for neural networks&#8217; forward and backward activation. </p>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
642 643 644 645
<dt>
<span class="target" id="paddleclasshppl_1_1Active_1a76a1d5f37f1b7d31b319b0314441e89f"></span><em class="property">typedef </em>&gt;</dt>
<dt id="_CPPv2IEN4hppl6ActiveI1TE7forwardE">
<em class="property">typedef </em>T (*<code class="descclassname">hppl::Active&lt;T&gt;::</code><code class="descname">forward</code>)<span class="sig-paren">(</span>T<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2IEN4hppl6ActiveI1TE7forwardE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
646 647 648
<dd></dd></dl>

<dl class="type">
649 650 651 652
<dt>
<span class="target" id="paddleclasshppl_1_1Active_1a7e21f0ec589d80e85270ceb67bf2f242"></span><em class="property">typedef </em>&gt;</dt>
<dt id="_CPPv2IEN4hppl6ActiveI1TE8backwardE">
<em class="property">typedef </em>T (*<code class="descclassname">hppl::Active&lt;T&gt;::</code><code class="descname">backward</code>)<span class="sig-paren">(</span>T, T<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2IEN4hppl6ActiveI1TE8backwardE" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681
<dd></dd></dl>

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

<dl class="type">
<dt id="_CPPv2N4hppl3cpuE">
<span id="hppl::cpu"></span><span class="target" id="paddlenamespacehppl_1_1cpu"></span><em class="property">namespace </em><code class="descname">cpu</code><a class="headerlink" href="#_CPPv2N4hppl3cpuE" title="Permalink to this definition"></a></dt>
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Variables</p>
<dl class="member">
<dt id="_CPPv2N4hppl3cpu7forwardE">
<span id="hppl::cpu::forward__Active:real:::forwardA"></span><span class="target" id="paddlenamespacehppl_1_1cpu_1a81ef3d73cd23d67665534da2184d1089"></span><a class="reference internal" href="#_CPPv2N4hppl6ActiveE" title="hppl::Active">Active</a>&lt;real&gt;::forward <code class="descname">forward</code>[]<a class="headerlink" href="#_CPPv2N4hppl3cpu7forwardE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N4hppl3cpu8backwardE">
<span id="hppl::cpu::backward__Active:real:::backwardA"></span><span class="target" id="paddlenamespacehppl_1_1cpu_1a243f812fd1c042994dbefd14071cd679"></span><a class="reference internal" href="#_CPPv2N4hppl6ActiveE" title="hppl::Active">Active</a>&lt;real&gt;::backward <code class="descname">backward</code>[]<a class="headerlink" href="#_CPPv2N4hppl3cpu8backwardE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

</div>
<div class="section" id="rnn-related-apis">
<h2>RNN Related APIs<a class="headerlink" href="#rnn-related-apis" title="Permalink to this headline"></a></h2>
<div class="breathe-sectiondef container">
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 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 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 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 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_RECURRENT_APPLY_CUH_">
<span class="target" id="paddlehl__recurrent__apply_8cuh_1af2f9b391a9ff094cbcffa895e2ff361a"></span><code class="descname">HL_RECURRENT_APPLY_CUH_</code><a class="headerlink" href="#c.HL_RECURRENT_APPLY_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv219hl_cpu_lstm_forward2Op13hl_lstm_valuei20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_cpu_lstm_forward__Op.hl_lstm_value.i.hl_activation_mode_t.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1af3a66ddbd557b8b2da732bf07b9cedc5"></span>void <code class="descname">hl_cpu_lstm_forward</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="../utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_cpu_lstm_forward2Op13hl_lstm_valuei20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Cpu lstm forward one sequence. </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">op</span></code> - <p>hl_lstm_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p><a class="reference internal" href="../utils/utils.html#paddlestructhl__lstm__value"><span class="std std-ref">hl_lstm_value</span></a> type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv220hl_cpu_lstm_backward2Op13hl_lstm_value12hl_lstm_gradi20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_cpu_lstm_backward__Op.hl_lstm_value.hl_lstm_grad.i.hl_activation_mode_t.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1a1aed386fe91bd0a4006d7c38ad69ff38"></span>void <code class="descname">hl_cpu_lstm_backward</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="../utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv220hl_cpu_lstm_backward2Op13hl_lstm_value12hl_lstm_gradi20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Cpu lstm backward one sequence. </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">op</span></code> - <p>hl_lstm_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>lstm value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>output gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv219hl_gpu_lstm_forward2Op13hl_lstm_valueii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_gpu_lstm_forward__Op.hl_lstm_value.i.i.hl_activation_mode_t.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1a33a6ed00dff9b0c122e9629cb0f70ea2"></span>void <code class="descname">hl_gpu_lstm_forward</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="../utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_gpu_lstm_forward2Op13hl_lstm_valueii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu lstm batch forward. </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">op</span></code> - <p>hl_lstm_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>lstm value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv220hl_gpu_lstm_backward2Op13hl_lstm_value12hl_lstm_gradii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_gpu_lstm_backward__Op.hl_lstm_value.hl_lstm_grad.i.i.hl_activation_mode_t.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1ad9f9761869ef408cb8dc371cde5e1ff1"></span>void <code class="descname">hl_gpu_lstm_backward</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="../utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv220hl_gpu_lstm_backward2Op13hl_lstm_value12hl_lstm_gradii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu lstm batch backward. </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">op</span></code> - <p>hl_lstm_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>lstm value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>lstm gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput, <em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv218hl_cpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_cpu_gru_forward__OpResetOutput.OpFinalOutput.hl_gru_value.i.i.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1a9b3f819c90ce882e93a95fa20879f789"></span>void <code class="descname">hl_cpu_gru_forward</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, OpFinalOutput <em>opFinalOutput</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_cpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Cpu gru forward. </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">opResetOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opFinalOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad, <em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv219hl_cpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_cpu_gru_backward__OpStateGrad.OpResetGrad.hl_gru_value.hl_gru_grad.i.i.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1a2ef50249da64bb485708c2cf3efd9640"></span>void <code class="descname">hl_cpu_gru_backward</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, OpResetGrad <em>opResetGrad</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_cpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Cpu gru forward. </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">opStateGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opResetGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>gru gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput, <em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv218hl_gpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_gpu_gru_forward__OpResetOutput.OpFinalOutput.hl_gru_value.i.i.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1a0dd6160432db7ae5a1f87b672504c191"></span>void <code class="descname">hl_gpu_gru_forward</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, OpFinalOutput <em>opFinalOutput</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_gpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu gru forward. </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">opResetOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opFinalOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad, <em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv219hl_gpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_gpu_gru_backward__OpStateGrad.OpResetGrad.hl_gru_value.hl_gru_grad.i.i.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__recurrent__apply_8cuh_1af3c80021a296432b817cb00b63c2ef37"></span>void <code class="descname">hl_gpu_gru_backward</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, OpResetGrad <em>opResetGrad</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_gpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu gru forward. </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">opStateGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opResetGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>gru gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
Y
Yu Yang 已提交
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 1016 1017 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
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv223hl_max_sequence_forwardP4realPKiP4realPiii">
<span id="hl_max_sequence_forward__realP.iCP.realP.iP.i.i"></span><span class="target" id="paddlehl__sequence_8h_1aaa754c2356daba3189c9b7a8b03b5797"></span>void <code class="descname">hl_max_sequence_forward</code><span class="sig-paren">(</span>real *<em>input</em>, <em class="property">const</em> int *<em>sequence</em>, real *<em>output</em>, int *<em>index</em>, int <em>numSequences</em>, int <em>dim</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv223hl_max_sequence_forwardP4realPKiP4realPiii" title="Permalink to this definition"></a></dt>
<dd><p>Maximum sequence forward. </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">input</span></code> - <p>each sequence contains some instances. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index.. </p>
</li>
<li><code class="first docutils literal"><span class="pre">output</span></code> - <p>max instance in this sequence. </p>
</li>
<li><code class="first docutils literal"><span class="pre">index</span></code> - <p>index of max instance. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>size of sequence[in]. </p>
</li>
<li><code class="first docutils literal"><span class="pre">dim</span></code> - <p>input dimension. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv224hl_max_sequence_backwardP4realPiP4realii">
<span id="hl_max_sequence_backward__realP.iP.realP.i.i"></span><span class="target" id="paddlehl__sequence_8h_1a5cd9a546e03a733ba4933434cbd1623b"></span>void <code class="descname">hl_max_sequence_backward</code><span class="sig-paren">(</span>real *<em>outputGrad</em>, int *<em>index</em>, real *<em>inputGrad</em>, int <em>numSequences</em>, int <em>dim</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv224hl_max_sequence_backwardP4realPiP4realii" title="Permalink to this definition"></a></dt>
<dd><p>Maximum sequence backward. </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">outputGrad</span></code> - <p>output gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">index</span></code> - <p>index of max instance. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputGrad</span></code> - <p>input gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>size of sequence[in]. </p>
</li>
<li><code class="first docutils literal"><span class="pre">dim</span></code> - <p>input dimension. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv229hl_context_projection_forwardP4realPKiP4realP4realiiiiib">
<span id="hl_context_projection_forward__realP.iCP.realP.realP.i.i.i.i.i.b"></span><span class="target" id="paddlehl__sequence_8h_1a7cdbb69d99c04287e8d192aba7e41a54"></span>void <code class="descname">hl_context_projection_forward</code><span class="sig-paren">(</span>real *<em>input</em>, <em class="property">const</em> int *<em>sequence</em>, real *<em>weightData</em>, real *<em>output</em>, int <em>numSequences</em>, int <em>inputDim</em>, int <em>contextLength</em>, int <em>contextStart</em>, int <em>beginPad</em>, bool <em>isPadding</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv229hl_context_projection_forwardP4realPKiP4realP4realiiiiib" title="Permalink to this definition"></a></dt>
<dd><p>Context projection forward. </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">input</span></code> - <p>input sequence. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index. </p>
</li>
<li><code class="first docutils literal"><span class="pre">weightData</span></code> - <p>padding data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">output</span></code> - <p>output sequence. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>number of sequences. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputDim</span></code> - <p>input sequence dimension. </p>
</li>
<li><code class="first docutils literal"><span class="pre">contextLength</span></code> - <p>context length. </p>
</li>
<li><code class="first docutils literal"><span class="pre">contextStart</span></code> - <p>context start. </p>
</li>
<li><code class="first docutils literal"><span class="pre">beginPad</span></code> - <p>number of extra timesteps added at the beginning. </p>
</li>
<li><code class="first docutils literal"><span class="pre">isPadding</span></code> - <p>trainable padding. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv235hl_context_projection_backward_dataP4realPKiP4realiiii">
<span id="hl_context_projection_backward_data__realP.iCP.realP.i.i.i.i"></span><span class="target" id="paddlehl__sequence_8h_1a493ef41808a8c1eec90379673fdaef73"></span>void <code class="descname">hl_context_projection_backward_data</code><span class="sig-paren">(</span>real *<em>outputGrad</em>, <em class="property">const</em> int *<em>sequence</em>, real *<em>inputGrad</em>, int <em>numSequences</em>, int <em>inputDim</em>, int <em>contextLength</em>, int <em>contextStart</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv235hl_context_projection_backward_dataP4realPKiP4realiiii" title="Permalink to this definition"></a></dt>
<dd><p>Context projection backward data. </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">outputGrad</span></code> - <p>output gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputGrad</span></code> - <p>input gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>number of sequences. </p>
</li>
<li><code class="first docutils literal"><span class="pre">inputDim</span></code> - <p>input sequence dimension. </p>
</li>
<li><code class="first docutils literal"><span class="pre">contextLength</span></code> - <p>context length. </p>
</li>
<li><code class="first docutils literal"><span class="pre">contextStart</span></code> - <p>context start. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv237hl_context_projection_backward_weightP4realPKiP4realiiiiii">
<span id="hl_context_projection_backward_weight__realP.iCP.realP.i.i.i.i.i.i"></span><span class="target" id="paddlehl__sequence_8h_1aec24cab2dee1023f7ed7286f85edd3ca"></span>void <code class="descname">hl_context_projection_backward_weight</code><span class="sig-paren">(</span>real *<em>outputGrad</em>, <em class="property">const</em> int *<em>sequence</em>, real *<em>weightGrad</em>, int <em>numSequences</em>, int <em>weightDim</em>, int <em>totalPad</em>, int <em>contextLength</em>, int <em>contextStart</em>, int <em>beginPad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv237hl_context_projection_backward_weightP4realPKiP4realiiiiii" title="Permalink to this definition"></a></dt>
<dd><p>Context projection backward weight. </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">outputGrad</span></code> - <p>output gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index. </p>
</li>
<li><code class="first docutils literal"><span class="pre">weightGrad</span></code> - <p>weight gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>number of sequences. </p>
</li>
<li><code class="first docutils literal"><span class="pre">weightDim</span></code> - <p>input sequence dimension. </p>
</li>
<li><code class="first docutils literal"><span class="pre">totalPad</span></code> - <p>number of extra timesteps. </p>
</li>
<li><code class="first docutils literal"><span class="pre">contextLength</span></code> - <p>context length. </p>
</li>
<li><code class="first docutils literal"><span class="pre">contextStart</span></code> - <p>context start. </p>
</li>
<li><code class="first docutils literal"><span class="pre">beginPad</span></code> - <p>number of extra timesteps added at the beginning. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
1070 1071
<dt id="_CPPv222hl_sequence2batch_copyP4realP4realPKiiib">
<span id="hl_sequence2batch_copy__realP.realP.iCP.i.i.b"></span><span class="target" id="paddlehl__sequence_8h_1a13d7f834880527645555849e05278745"></span>void <code class="descname">hl_sequence2batch_copy</code><span class="sig-paren">(</span>real *<em>batch</em>, real *<em>sequence</em>, <em class="property">const</em> int *<em>batchIndex</em>, int <em>seqWidth</em>, int <em>batchCount</em>, bool <em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv222hl_sequence2batch_copyP4realP4realPKiiib" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291
<dd><p>Memory copy from sequence to batch. </p>
<p>if seq2batch == true</p>
<p>copy from sequence to batch: batch[i] = sequence[batchIndex[i]].</p>
<p>if seq2batch == false</p>
<p>copy from batch to sequence: sequence[batchIndex[i]] = batch[i].</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">batch</span></code> - <p>batch matrix. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>equence matrix. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchIndex</span></code> - <p>index vector. </p>
</li>
<li><code class="first docutils literal"><span class="pre">seqWidth</span></code> - <p>width of sequence. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchCount</span></code> - <p>number of batchIndex. </p>
</li>
<li><code class="first docutils literal"><span class="pre">seq2batch</span></code> - <p>copy direction. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv221hl_sequence2batch_addP4realP4realPiiib">
<span id="hl_sequence2batch_add__realP.realP.iP.i.i.b"></span><span class="target" id="paddlehl__sequence_8h_1aa64a666f1fc82119a0d2cb2a83b1e971"></span>void <code class="descname">hl_sequence2batch_add</code><span class="sig-paren">(</span>real *<em>batch</em>, real *<em>sequence</em>, int *<em>batchIndex</em>, int <em>seqWidth</em>, int <em>batchCount</em>, bool <em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv221hl_sequence2batch_addP4realP4realPiiib" title="Permalink to this definition"></a></dt>
<dd><p>Add sequence to batch. </p>
<p>if seq2batch == true</p>
<p>add sequence to batch: batch[i] = sequence[batchIndex[i]].</p>
<p>if seq2batch == false</p>
<p>add batch to sequence: sequence[batchIndex[i]] = batch[i].</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">batch</span></code> - <p>batch matrix. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>equence matrix. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchIndex</span></code> - <p>index vector. </p>
</li>
<li><code class="first docutils literal"><span class="pre">seqWidth</span></code> - <p>width of sequence. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchCount</span></code> - <p>number of batchIndex. </p>
</li>
<li><code class="first docutils literal"><span class="pre">seq2batch</span></code> - <p>copy direction. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv223hl_sequence_avg_forwardP4realP4realPKiiiKi">
<span id="hl_sequence_avg_forward__realP.realP.iCP.i.i.iC"></span><span class="target" id="paddlehl__sequence_8h_1aa229c82778eb772a4da54ddc8aa51f7d"></span>void <code class="descname">hl_sequence_avg_forward</code><span class="sig-paren">(</span>real *<em>dst</em>, real *<em>src</em>, <em class="property">const</em> int *<em>starts</em>, int <em>height</em>, int <em>width</em>, <em class="property">const</em> int <em>mode</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv223hl_sequence_avg_forwardP4realP4realPKiiiKi" title="Permalink to this definition"></a></dt>
<dd><p>dst = Op(src), src is sequence. </p>
<p>mode = 0, Op is average.</p>
<p>mode = 1, Op is sum.</p>
<p>mode = 2, Op is sum(src)/sqrt(N), N is sequence length.</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">dst</span></code> - <p>destination data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">src</span></code> - <p>source data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">starts</span></code> - <p>sequence start positions. </p>
</li>
<li><code class="first docutils literal"><span class="pre">height</span></code> - <p>height of dst data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">width</span></code> - <p>width of dst data. </p>
</li>
<li><code class="first docutils literal"><span class="pre">mode</span></code> - <p>0: avreage, 1: sum, 2: divide by square root of sequenceLength </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="section" id="lstm-model">
<h3>LSTM Model<a class="headerlink" href="#lstm-model" title="Permalink to this headline"></a></h3>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv224hl_lstm_parallel_forwardP4realP4realP4realP4realP4realP4realP4realP4realPKiiib20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_lstm_parallel_forward__realP.realP.realP.realP.realP.realP.realP.realP.iCP.i.i.b.hl_activation_mode_t.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__lstm_8h_1af546c831207320e47f77a3cff8230202"></span>void <code class="descname">hl_lstm_parallel_forward</code><span class="sig-paren">(</span>real *<em>gateValue</em>, real *<em>stateValue</em>, real *<em>preOutputValue</em>, real *<em>outputValue</em>, real *<em>checkIg</em>, real *<em>checkFg</em>, real *<em>checkOg</em>, real *<em>weight</em>, <em class="property">const</em> int *<em>sequence</em>, int <em>frameSize</em>, int <em>numSequences</em>, bool <em>reversed</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv224hl_lstm_parallel_forwardP4realP4realP4realP4realP4realP4realP4realP4realPKiiib20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Lstm sequence parallel forward. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Only support frameSize = 32 or 64. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">gateValue</span></code> - <p>input value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">stateValue</span></code> - <p>state value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">preOutputValue</span></code> - <p>prev output value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputValue</span></code> - <p>output value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkIg</span></code> - <p>bias. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkFg</span></code> - <p>bias. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkOg</span></code> - <p>bias. </p>
</li>
<li><code class="first docutils literal"><span class="pre">weight</span></code> - <p>weight. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>number of sequences. </p>
</li>
<li><code class="first docutils literal"><span class="pre">reversed</span></code> - <p>reverse. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type.</p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv230hl_lstm_parallel_backward_dataP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realPKiiib20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span id="hl_lstm_parallel_backward_data__realP.realP.realP.realP.realP.realP.realP.realP.realP.realP.realP.realP.realP.realP.iCP.i.i.b.hl_activation_mode_t.hl_activation_mode_t.hl_activation_mode_t"></span><span class="target" id="paddlehl__lstm_8h_1a47ce31f143dce64d07ec263150b9ab5c"></span>void <code class="descname">hl_lstm_parallel_backward_data</code><span class="sig-paren">(</span>real *<em>gateValue</em>, real *<em>gateGrad</em>, real *<em>stateValue</em>, real *<em>stateGrad</em>, real *<em>preOutputValue</em>, real *<em>preOutputGrad</em>, real *<em>outputGrad</em>, real *<em>checkIg</em>, real *<em>checkIgGrad</em>, real *<em>checkFg</em>, real *<em>checkFgGrad</em>, real *<em>checkOg</em>, real *<em>checkOgGrad</em>, real *<em>weight</em>, <em class="property">const</em> int *<em>sequence</em>, int <em>frameSize</em>, int <em>numSequences</em>, bool <em>reversed</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv230hl_lstm_parallel_backward_dataP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realP4realPKiiib20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Lstm sequence parallel backward data. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Only support frameSize = 32 or 64. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">gateValue</span></code> - <p>input value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">gateGrad</span></code> - <p>input gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">stateValue</span></code> - <p>state value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">stateGrad</span></code> - <p>state gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">preOutputValue</span></code> - <p>prev output value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">preOutputGrad</span></code> - <p>prev output gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputGrad</span></code> - <p>output gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkIg</span></code> - <p>bias. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkIgGrad</span></code> - <p>bias gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkFg</span></code> - <p>bias. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkFgGrad</span></code> - <p>bias gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkOg</span></code> - <p>bias. </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkOgGrad</span></code> - <p>bias gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">weight</span></code> - <p>weight. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>number of sequences. </p>
</li>
<li><code class="first docutils literal"><span class="pre">reversed</span></code> - <p>reverse. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type.</p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv232hl_lstm_parallel_backward_weightP4realP4realP4realPKiiiib">
<span id="hl_lstm_parallel_backward_weight__realP.realP.realP.iCP.i.i.i.b"></span><span class="target" id="paddlehl__lstm_8h_1a753967b0dc0d6cf76ae3f1c4cfb13a7e"></span>void <code class="descname">hl_lstm_parallel_backward_weight</code><span class="sig-paren">(</span>real *<em>weightGrad</em>, real *<em>outputValue</em>, real *<em>gateGrad</em>, <em class="property">const</em> int *<em>sequence</em>, int <em>frameSize</em>, int <em>batchSize</em>, int <em>numSequences</em>, bool <em>reversed</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv232hl_lstm_parallel_backward_weightP4realP4realP4realPKiiiib" title="Permalink to this definition"></a></dt>
<dd><p>Lstm sequence parallel backward weight. </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">weightGrad</span></code> - <p>weight gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputValue</span></code> - <p>output value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">gateGrad</span></code> - <p>gate gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">sequence</span></code> - <p>sequence index. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>batch size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">numSequences</span></code> - <p>number of sequences. </p>
</li>
<li><code class="first docutils literal"><span class="pre">reversed</span></code> - <p>reverse. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 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 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 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 1470 1471 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 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 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 1579 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 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 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 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_GPU_LSTM_CUH_">
<span class="target" id="paddlehl__gpu__lstm_8cuh_1a9db03d76b9b64bf3f200d39cb69c5b5d"></span><code class="descname">HL_GPU_LSTM_CUH_</code><a class="headerlink" href="#c.HL_GPU_LSTM_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv219hl_gpu_lstm_forward2Op13hl_lstm_valueii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span class="target" id="paddlehl__gpu__lstm_8cuh_1a33a6ed00dff9b0c122e9629cb0f70ea2"></span>void <code class="descname">hl_gpu_lstm_forward</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="../utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_gpu_lstm_forward2Op13hl_lstm_valueii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu lstm batch forward. </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">op</span></code> - <p>hl_lstm_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>lstm value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv220hl_gpu_lstm_backward2Op13hl_lstm_value12hl_lstm_gradii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t">
<span class="target" id="paddlehl__gpu__lstm_8cuh_1ad9f9761869ef408cb8dc371cde5e1ff1"></span>void <code class="descname">hl_gpu_lstm_backward</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="../utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv220hl_gpu_lstm_backward2Op13hl_lstm_value12hl_lstm_gradii20hl_activation_mode_t20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu lstm batch backward. </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">op</span></code> - <p>hl_lstm_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>lstm value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>lstm gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_state</span></code> - <p>actvie gate type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_LSTM_OPS_CUH_">
<span class="target" id="paddlehl__lstm__ops_8cuh_1af5330d5e0bd6bf5fb27a4c1ebac6347b"></span><code class="descname">HL_LSTM_OPS_CUH_</code><a class="headerlink" href="#c.HL_LSTM_OPS_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="macro">
<dt id="c.INLINE">
<span class="target" id="paddlehl__lstm__ops_8cuh_1a2eb6f9e0395b47b8d5e3eeae4fe0c116"></span><code class="descname">INLINE</code><a class="headerlink" href="#c.INLINE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<dl class="type">
<dt>
<span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code></dt>
<dd><dl class="type">
<dt id="_CPPv2N4hppl8backwardE">
<span id="hppl::backward"></span><span class="target" id="paddlenamespacehppl_1_1backward"></span><em class="property">namespace </em><code class="descname">backward</code><a class="headerlink" href="#_CPPv2N4hppl8backwardE" title="Permalink to this definition"></a></dt>
<dd><dl class="class">
<dt id="_CPPv2N4hppl8backward4lstmE">
<span id="hppl::backward::lstm"></span><span class="target" id="paddleclasshppl_1_1backward_1_1lstm"></span><em class="property">class </em><code class="descname">lstm</code><a class="headerlink" href="#_CPPv2N4hppl8backward4lstmE" 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>
<span class="target" id="paddleclasshppl_1_1backward_1_1lstm_1a6e26767fd02619c727972b3e678cb961"></span><code class="descname">INLINE void hppl::backward::lstm::operator()(real &amp; valueIn, real &amp; valueIg, real &amp; valueFg, real &amp; valueOg, real &amp; gradIn, real &amp; gradIg, real &amp; gradFg, real &amp; gradOg, real &amp; prevState, real &amp; prevStateGrad, real &amp; state, real &amp; stateGrad, real &amp; stateAtv, real &amp; outputGrad, real &amp; checkI, real &amp; checkF, real &amp; checkO, real &amp; checkIGrad, real &amp; checkFGrad, real &amp; checkOGrad, Active &lt; real &gt;::backward actInput, Active &lt; real &gt;::backward actGate, Active &lt; real &gt;::backward actState)</code></dt>
<dd><p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">valueIn</span></code> - <p>input </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueIg</span></code> - <p>input gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueFg</span></code> - <p>forget gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueOg</span></code> - <p>output gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradIn</span></code> - <p>input grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradIg</span></code> - <p>input gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradFg</span></code> - <p>forget gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradOg</span></code> - <p>output gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">prevState</span></code> - <p>previous state value </p>
</li>
<li><code class="first docutils literal"><span class="pre">prevStateGrad</span></code> - <p>previous state grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">state</span></code> - <p>current state value </p>
</li>
<li><code class="first docutils literal"><span class="pre">stateGrad</span></code> - <p>current state grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">stateAtv</span></code> - <p>state active </p>
</li>
<li><code class="first docutils literal"><span class="pre">outputGrad</span></code> - <p>output grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkI</span></code> - <p>check input gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkF</span></code> - <p>check forget gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkO</span></code> - <p>check output gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkIGrad</span></code> - <p>check input gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkFGrad</span></code> - <p>check forget gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkOGrad</span></code> - <p>check output gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">actInput</span></code> - <p>backward function of input </p>
</li>
<li><code class="first docutils literal"><span class="pre">actGate</span></code> - <p>backward function of gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">actState</span></code> - <p>backward function of state </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N4hppl8backward4lstm3avxE">
<span id="hppl::backward::lstm::avx__bC"></span><span class="target" id="paddleclasshppl_1_1backward_1_1lstm_1abf29cac1557306effeffa19d856efd64"></span><em class="property">const</em> bool <code class="descname">avx</code><a class="headerlink" href="#_CPPv2N4hppl8backward4lstm3avxE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

<dl class="type">
<dt id="_CPPv2N4hppl7forwardE">
<span id="hppl::forward"></span><span class="target" id="paddlenamespacehppl_1_1forward"></span><em class="property">namespace </em><code class="descname">forward</code><a class="headerlink" href="#_CPPv2N4hppl7forwardE" title="Permalink to this definition"></a></dt>
<dd><dl class="class">
<dt id="_CPPv2N4hppl7forward4lstmE">
<span id="hppl::forward::lstm"></span><span class="target" id="paddleclasshppl_1_1forward_1_1lstm"></span><em class="property">class </em><code class="descname">lstm</code><a class="headerlink" href="#_CPPv2N4hppl7forward4lstmE" 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>
<span class="target" id="paddleclasshppl_1_1forward_1_1lstm_1a10c54c71a009845eadbd895c660420f8"></span><code class="descname">INLINE void hppl::forward::lstm::operator()(real &amp; valueIn, real &amp; valueIg, real &amp; valueFg, real &amp; valueOg, real &amp; prevState, real &amp; state, real &amp; stateAtv, real &amp; output, real &amp; checkI, real &amp; checkF, real &amp; checkO, Active &lt; real &gt;::forward actInput, Active &lt; real &gt;::forward actGate, Active &lt; real &gt;::forward actState)</code></dt>
<dd><p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">valueIn</span></code> - <p>input </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueIg</span></code> - <p>input gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueFg</span></code> - <p>forget gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueOg</span></code> - <p>output gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">prevState</span></code> - <p>previous state </p>
</li>
<li><code class="first docutils literal"><span class="pre">state</span></code> - <p>current state </p>
</li>
<li><code class="first docutils literal"><span class="pre">stateAtv</span></code> - <p>state active </p>
</li>
<li><code class="first docutils literal"><span class="pre">output</span></code> - <p>output </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkI</span></code> - <p>check input gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkF</span></code> - <p>check forget gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">checkO</span></code> - <p>check output gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">actInput</span></code> - <p>forward function of input </p>
</li>
<li><code class="first docutils literal"><span class="pre">actGate</span></code> - <p>forward function of gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">actState</span></code> - <p>forward function of state </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N4hppl7forward4lstm3avxE">
<span id="hppl::forward::lstm::avx__bC"></span><span class="target" id="paddleclasshppl_1_1forward_1_1lstm_1a4bfb931ed2fa848d205426b40a2a2562"></span><em class="property">const</em> bool <code class="descname">avx</code><a class="headerlink" href="#_CPPv2N4hppl7forward4lstm3avxE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

</dd></dl>

</div>
<div class="section" id="gru-model">
<h3>GRU Model<a class="headerlink" href="#gru-model" title="Permalink to this headline"></a></h3>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_GRU_OPS_CUH_">
<span class="target" id="paddlehl__gru__ops_8cuh_1a2f7ac44d535321962a195208eb1763f7"></span><code class="descname">HL_GRU_OPS_CUH_</code><a class="headerlink" href="#c.HL_GRU_OPS_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="macro">
<dt>
<span class="target" id="paddlehl__gru__ops_8cuh_1a2eb6f9e0395b47b8d5e3eeae4fe0c116"></span><code class="descname">INLINE</code></dt>
<dd></dd></dl>

</div>
<dl class="type">
<dt>
<span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code></dt>
<dd><dl class="type">
<dt id="_CPPv2N4hppl8backwardE">
<span class="target" id="paddlenamespacehppl_1_1backward"></span><em class="property">namespace </em><code class="descname">backward</code><a class="headerlink" href="#_CPPv2N4hppl8backwardE" title="Permalink to this definition"></a></dt>
<dd><dl class="class">
<dt id="_CPPv2N4hppl8backward13gru_stateGradE">
<span id="hppl::backward::gru_stateGrad"></span><span class="target" id="paddleclasshppl_1_1backward_1_1gru__stateGrad"></span><em class="property">class </em><code class="descname">gru_stateGrad</code><a class="headerlink" href="#_CPPv2N4hppl8backward13gru_stateGradE" 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>
<span class="target" id="paddleclasshppl_1_1backward_1_1gru__stateGrad_1a67d561cb703eb55be5cd7be41832886b"></span><code class="descname">INLINE void hppl::backward::gru_stateGrad::operator()(real &amp; valueUpdateGate, real &amp; gradUpdateGate, real &amp; valueFrameState, real &amp; gradFrameState, real &amp; valuePrevOut, real &amp; gradPrevOut, real &amp; gradOutput, Active &lt; real &gt;::backward actInput)</code></dt>
<dd><p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">valueUpdateGate</span></code> - <p>update gate value </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradUpdateGate</span></code> - <p>update gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueFrameState</span></code> - <p>frame state value </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradFrameState</span></code> - <p>frame state grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">valuePrevOut</span></code> - <p>previous output value </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradPrevOut</span></code> - <p>previous output grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradOutput</span></code> - <p>output grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">actInput</span></code> - <p>backward function of frame state </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N4hppl8backward13gru_stateGrad3avxE">
<span id="hppl::backward::gru_stateGrad::avx__bC"></span><span class="target" id="paddleclasshppl_1_1backward_1_1gru__stateGrad_1a8bfca723f4ce0aba046b6701eb987f34"></span><em class="property">const</em> bool <code class="descname">avx</code><a class="headerlink" href="#_CPPv2N4hppl8backward13gru_stateGrad3avxE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

<dl class="class">
<dt id="_CPPv2N4hppl8backward13gru_resetGradE">
<span id="hppl::backward::gru_resetGrad"></span><span class="target" id="paddleclasshppl_1_1backward_1_1gru__resetGrad"></span><em class="property">class </em><code class="descname">gru_resetGrad</code><a class="headerlink" href="#_CPPv2N4hppl8backward13gru_resetGradE" 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>
<span class="target" id="paddleclasshppl_1_1backward_1_1gru__resetGrad_1a26e3ee08a90e0475fae6421bbc23332e"></span><code class="descname">INLINE void hppl::backward::gru_resetGrad::operator()(real &amp; valueUpdateGate, real &amp; gradUpdateGate, real &amp; valueResetGate, real &amp; gradResetGate, real &amp; valuePrevOut, real &amp; gradPrevOut, real &amp; gradResetOutput, Active &lt; real &gt;::backward actGate)</code></dt>
<dd><p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">valueUpdateGate</span></code> - <p>update gate value </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradUpdateGate</span></code> - <p>update gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueResetGate</span></code> - <p>reset gate value </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradResetGate</span></code> - <p>reset gate grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">valuePrevOut</span></code> - <p>previous output value </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradPrevOut</span></code> - <p>previous output grad </p>
</li>
<li><code class="first docutils literal"><span class="pre">gradResetOutput</span></code> - <p>reset output grad (temp val) </p>
</li>
<li><code class="first docutils literal"><span class="pre">actGate</span></code> - <p>backward function of gate </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N4hppl8backward13gru_resetGrad3avxE">
<span id="hppl::backward::gru_resetGrad::avx__bC"></span><span class="target" id="paddleclasshppl_1_1backward_1_1gru__resetGrad_1a8397d4c28ac024a8c5fe2511b68e64bf"></span><em class="property">const</em> bool <code class="descname">avx</code><a class="headerlink" href="#_CPPv2N4hppl8backward13gru_resetGrad3avxE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

<dl class="type">
<dt id="_CPPv2N4hppl7forwardE">
<span class="target" id="paddlenamespacehppl_1_1forward"></span><em class="property">namespace </em><code class="descname">forward</code><a class="headerlink" href="#_CPPv2N4hppl7forwardE" title="Permalink to this definition"></a></dt>
<dd><dl class="class">
<dt id="_CPPv2N4hppl7forward15gru_resetOutputE">
<span id="hppl::forward::gru_resetOutput"></span><span class="target" id="paddleclasshppl_1_1forward_1_1gru__resetOutput"></span><em class="property">class </em><code class="descname">gru_resetOutput</code><a class="headerlink" href="#_CPPv2N4hppl7forward15gru_resetOutputE" 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>
<span class="target" id="paddleclasshppl_1_1forward_1_1gru__resetOutput_1a6a816cf9083105a532d1597717137ee4"></span><code class="descname">INLINE void hppl::forward::gru_resetOutput::operator()(real &amp; valueUpdateGate, real &amp; valueResetGate, real &amp; prevOut, real &amp; valueResetOutput, Active &lt; real &gt;::forward actGate)</code></dt>
<dd><p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">valueUpdateGate</span></code> - <p>update gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueResetGate</span></code> - <p>reset gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">prevOut</span></code> - <p>previous output </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueResetOutput</span></code> - <p>intermediate value for frame state </p>
</li>
<li><code class="first docutils literal"><span class="pre">actGate</span></code> - <p>forward function of gate </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N4hppl7forward15gru_resetOutput3avxE">
<span id="hppl::forward::gru_resetOutput::avx__bC"></span><span class="target" id="paddleclasshppl_1_1forward_1_1gru__resetOutput_1af4515a381affbc6a3129cb8ccdf61651"></span><em class="property">const</em> bool <code class="descname">avx</code><a class="headerlink" href="#_CPPv2N4hppl7forward15gru_resetOutput3avxE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

<dl class="class">
<dt id="_CPPv2N4hppl7forward15gru_finalOutputE">
<span id="hppl::forward::gru_finalOutput"></span><span class="target" id="paddleclasshppl_1_1forward_1_1gru__finalOutput"></span><em class="property">class </em><code class="descname">gru_finalOutput</code><a class="headerlink" href="#_CPPv2N4hppl7forward15gru_finalOutputE" 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>
<span class="target" id="paddleclasshppl_1_1forward_1_1gru__finalOutput_1add0b11d781c2c85d0d92b04a7c3075fb"></span><code class="descname">INLINE void hppl::forward::gru_finalOutput::operator()(real &amp; valueUpdateGate, real &amp; valueFrameState, real &amp; prevOut, real &amp; valueOutput, Active &lt; real &gt;::forward actInput)</code></dt>
<dd><p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">valueUpdateGate</span></code> - <p>update gate </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueFrameState</span></code> - <p>frame state ({{h}_t}) </p>
</li>
<li><code class="first docutils literal"><span class="pre">prevOut</span></code> - <p>previous output </p>
</li>
<li><code class="first docutils literal"><span class="pre">valueOutput</span></code> - <p>output </p>
</li>
<li><code class="first docutils literal"><span class="pre">actInput</span></code> - <p>forward function of node </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N4hppl7forward15gru_finalOutput3avxE">
<span id="hppl::forward::gru_finalOutput::avx__bC"></span><span class="target" id="paddleclasshppl_1_1forward_1_1gru__finalOutput_1a64025b149d833188a663f75c3874c5a1"></span><em class="property">const</em> bool <code class="descname">avx</code><a class="headerlink" href="#_CPPv2N4hppl7forward15gru_finalOutput3avxE" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

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

</dd></dl>

</dd></dl>

<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_CPU_GRU_CUH_">
<span class="target" id="paddlehl__cpu__gru_8cuh_1a990b01f00c17e1957703eb33aab6e66a"></span><code class="descname">HL_CPU_GRU_CUH_</code><a class="headerlink" href="#c.HL_CPU_GRU_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="macro">
<dt id="c.CBLAS_GEMM">
<span class="target" id="paddlehl__cpu__gru_8cuh_1aea84bbfa49110a0d98992a50fce02fa9"></span><code class="descname">CBLAS_GEMM</code><a class="headerlink" href="#c.CBLAS_GEMM" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput&gt;</dt>
<dt id="_CPPv233hl_naive_gru_forward_reset_output13OpResetOutputP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_naive_gru_forward_reset_output__OpResetOutput.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a7bd65d1c8b455981e4f0a38f814593f6"></span>void <code class="descname">hl_naive_gru_forward_reset_output</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, real *<em>gateValue</em>, real *<em>resetOutputValue</em>, real *<em>prevOutputValue</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv233hl_naive_gru_forward_reset_output13OpResetOutputP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv233hl_naive_gru_forward_final_output13OpFinalOutputP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_naive_gru_forward_final_output__OpFinalOutput.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a736d07a80fad4730afbb4ceae05f3075"></span>void <code class="descname">hl_naive_gru_forward_final_output</code><span class="sig-paren">(</span>OpFinalOutput <em>opFinalOutput</em>, real *<em>gateValue</em>, real *<em>prevOutputValue</em>, real *<em>outputValue</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv233hl_naive_gru_forward_final_output13OpFinalOutputP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput&gt;</dt>
<dt id="_CPPv231hl_avx_gru_forward_reset_output13OpResetOutputP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_avx_gru_forward_reset_output__OpResetOutput.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1abb4a2e8674ecaeaabebf14732e9571ad"></span>void <code class="descname">hl_avx_gru_forward_reset_output</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, real *<em>gateValue</em>, real *<em>resetOutputValue</em>, real *<em>prevOutputValue</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv231hl_avx_gru_forward_reset_output13OpResetOutputP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv231hl_avx_gru_forward_final_output13OpFinalOutputP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_avx_gru_forward_final_output__OpFinalOutput.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a6144838586949d4efd15e37223e29756"></span>void <code class="descname">hl_avx_gru_forward_final_output</code><span class="sig-paren">(</span>OpFinalOutput <em>opFinalOutput</em>, real *<em>gateValue</em>, real *<em>prevOutputValue</em>, real *<em>outputValue</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv231hl_avx_gru_forward_final_output13OpFinalOutputP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput&gt;</dt>
<dt id="_CPPv220forward_reset_output13OpResetOutput12hl_gru_valueii20hl_activation_mode_t">
<span id="forward_reset_output__OpResetOutput.hl_gru_value.i.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1abacdfe4b37523ffd69292f733764fe58"></span>void <code class="descname">forward_reset_output</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv220forward_reset_output13OpResetOutput12hl_gru_valueii20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv220forward_final_output13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t">
<span id="forward_final_output__OpFinalOutput.hl_gru_value.i.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1aec87684a9b0cf3c1f6836057240a7199"></span>void <code class="descname">forward_final_output</code><span class="sig-paren">(</span>OpFinalOutput <em>opFinalOutput</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv220forward_final_output13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput, <em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv218hl_cpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t">
<span class="target" id="paddlehl__cpu__gru_8cuh_1a9b3f819c90ce882e93a95fa20879f789"></span>void <code class="descname">hl_cpu_gru_forward</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, OpFinalOutput <em>opFinalOutput</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_cpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Cpu gru forward. </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">opResetOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opFinalOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad&gt;</dt>
<dt id="_CPPv232hl_naive_gru_backward_state_grad11OpStateGradP4realP4realP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_naive_gru_backward_state_grad__OpStateGrad.realP.realP.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1aa3a449bcce667011caef862cad2b213c"></span>void <code class="descname">hl_naive_gru_backward_state_grad</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, real *<em>gateValue</em>, real *<em>gateGrad</em>, real *<em>prevOutValue</em>, real *<em>prevOutGrad</em>, real *<em>outputGrad</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv232hl_naive_gru_backward_state_grad11OpStateGradP4realP4realP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv232hl_naive_gru_backward_reset_grad11OpResetGradP4realP4realP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_naive_gru_backward_reset_grad__OpResetGrad.realP.realP.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a0670491d5f88a3a37e504cc1a5eb576d"></span>void <code class="descname">hl_naive_gru_backward_reset_grad</code><span class="sig-paren">(</span>OpResetGrad <em>opResetGrad</em>, real *<em>gateValue</em>, real *<em>gateGrad</em>, real *<em>prevOutValue</em>, real *<em>prevOutGrad</em>, real *<em>resetOutputGrad</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv232hl_naive_gru_backward_reset_grad11OpResetGradP4realP4realP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad&gt;</dt>
<dt id="_CPPv230hl_avx_gru_backward_state_grad11OpStateGradP4realP4realP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_avx_gru_backward_state_grad__OpStateGrad.realP.realP.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a234f3ae5bbde038a6b2a8231d726d4b8"></span>void <code class="descname">hl_avx_gru_backward_state_grad</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, real *<em>gateValue</em>, real *<em>gateGrad</em>, real *<em>prevOutValue</em>, real *<em>prevOutGrad</em>, real *<em>outputGrad</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv230hl_avx_gru_backward_state_grad11OpStateGradP4realP4realP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv230hl_avx_gru_backward_reset_grad11OpResetGradP4realP4realP4realP4realP4reali20hl_activation_mode_t">
<span id="hl_avx_gru_backward_reset_grad__OpResetGrad.realP.realP.realP.realP.realP.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1aef3c3b49022aee2da6743fcd6d737605"></span>void <code class="descname">hl_avx_gru_backward_reset_grad</code><span class="sig-paren">(</span>OpResetGrad <em>opResetGrad</em>, real *<em>gateValue</em>, real *<em>gateGrad</em>, real *<em>prevOutValue</em>, real *<em>prevOutGrad</em>, real *<em>resetOutputGrad</em>, int <em>frameSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv230hl_avx_gru_backward_reset_grad11OpResetGradP4realP4realP4realP4realP4reali20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad&gt;</dt>
<dt id="_CPPv219backward_state_grad11OpStateGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t">
<span id="backward_state_grad__OpStateGrad.hl_gru_value.hl_gru_grad.i.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a26b6ed1b10222a23c95792168202b2c5"></span>void <code class="descname">backward_state_grad</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219backward_state_grad11OpStateGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv219backward_reset_grad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t">
<span id="backward_reset_grad__OpResetGrad.hl_gru_value.hl_gru_grad.i.i.hl_activation_mode_t"></span><span class="target" id="paddlehl__cpu__gru_8cuh_1a0e75490a552b3251dee3615c44a312e1"></span>void <code class="descname">backward_reset_grad</code><span class="sig-paren">(</span>OpResetGrad <em>opResetGrad</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219backward_reset_grad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad, <em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv219hl_cpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t">
<span class="target" id="paddlehl__cpu__gru_8cuh_1a2ef50249da64bb485708c2cf3efd9640"></span>void <code class="descname">hl_cpu_gru_backward</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, OpResetGrad <em>opResetGrad</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_cpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Cpu gru forward. </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">opStateGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opResetGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>gru gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.HL_GPU_GRU_CUH_">
<span class="target" id="paddlehl__gpu__gru_8cuh_1acba20561cffe35afde8c67313b1ea2b2"></span><code class="descname">HL_GPU_GRU_CUH_</code><a class="headerlink" href="#c.HL_GPU_GRU_CUH_" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpResetOutput, <em class="property">class</em> OpFinalOutput&gt;</dt>
<dt id="_CPPv218hl_gpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t">
<span class="target" id="paddlehl__gpu__gru_8cuh_1a0dd6160432db7ae5a1f87b672504c191"></span>void <code class="descname">hl_gpu_gru_forward</code><span class="sig-paren">(</span>OpResetOutput <em>opResetOutput</em>, OpFinalOutput <em>opFinalOutput</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_gpu_gru_forward13OpResetOutput13OpFinalOutput12hl_gru_valueii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu gru forward. </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">opResetOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opFinalOutput</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> OpStateGrad, <em class="property">class</em> OpResetGrad&gt;</dt>
<dt id="_CPPv219hl_gpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t">
<span class="target" id="paddlehl__gpu__gru_8cuh_1af3c80021a296432b817cb00b63c2ef37"></span>void <code class="descname">hl_gpu_gru_backward</code><span class="sig-paren">(</span>OpStateGrad <em>opStateGrad</em>, OpResetGrad <em>opResetGrad</em>, <a class="reference internal" href="../utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_node</em>, <a class="reference internal" href="../utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <em>active_gate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_gpu_gru_backward11OpStateGrad11OpResetGrad12hl_gru_value11hl_gru_gradii20hl_activation_mode_t20hl_activation_mode_t" title="Permalink to this definition"></a></dt>
<dd><p>Gpu gru forward. </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">opStateGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">opResetGrad</span></code> - <p>hl_gru_ops.cuh </p>
</li>
<li><code class="first docutils literal"><span class="pre">value</span></code> - <p>gru value. </p>
</li>
<li><code class="first docutils literal"><span class="pre">grad</span></code> - <p>gru gradient. </p>
</li>
<li><code class="first docutils literal"><span class="pre">frameSize</span></code> - <p>frame length/size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">batchSize</span></code> - <p>size of current batch. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_node</span></code> - <p>active input type. </p>
</li>
<li><code class="first docutils literal"><span class="pre">active_gate</span></code> - <p>active state type. </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

Y
Yu Yang 已提交
1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986
</div>
</div>
</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>
<li><a class="reference internal" href="#">Neural Networks</a><ul>
<li><a class="reference internal" href="#base">Base</a></li>
<li><a class="reference internal" href="#activation-functions">Activation Functions</a></li>
<li><a class="reference internal" href="#rnn-related-apis">RNN Related APIs</a><ul>
<li><a class="reference internal" href="#lstm-model">LSTM Model</a></li>
<li><a class="reference internal" href="#gru-model">GRU Model</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">RNN</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../utils/index.html"
                        title="next chapter">Utils</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/source/cuda/rnn/rnn.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">
1987 1988
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
      <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" >
          <a href="../utils/index.html" title="Utils"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="RNN"
             >previous</a> |</li>
2013 2014 2015
        <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" >RNN</a> &#187;</li> 
Y
Yu Yang 已提交
2016 2017 2018
      </ul>
    </div>
    <div class="footer" role="contentinfo">
2019
        &#169; Copyright 2016, PaddlePaddle developers.
2020
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.
Y
Yu Yang 已提交
2021 2022 2023
    </div>
  </body>
</html>