rnn.html 143.3 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
      </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>
77
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
78 79 80 81 82 83 84
<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>
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">dataCol</span></code>: expand data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">blockH</span></code>: filter height. </li>
<li><code class="docutils literal"><span class="pre">blockW</span></code>: filter width. </li>
<li><code class="docutils literal"><span class="pre">strideH</span></code>: stride height. </li>
<li><code class="docutils literal"><span class="pre">strideW</span></code>: stride width. </li>
<li><code class="docutils literal"><span class="pre">paddingH</span></code>: padding height. </li>
<li><code class="docutils literal"><span class="pre">paddingW</span></code>: padding width. </li>
<li><code class="docutils literal"><span class="pre">outputH</span></code>: output height. </li>
<li><code class="docutils literal"><span class="pre">outputW</span></code>: output width. </li>
<li><code class="docutils literal"><span class="pre">dataIm</span></code>: output image data. </li>
<li><code class="docutils literal"><span class="pre">alpha</span></code>: </li>
<li><code class="docutils literal"><span class="pre">beta</span></code>: </li>
Y
Yu Yang 已提交
101 102 103 104 105 106 107 108 109 110 111 112
</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>
113 114 115 116 117 118 119 120 121 122 123 124 125 126
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">dataIm</span></code>: input image data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">blockH</span></code>: filter height. </li>
<li><code class="docutils literal"><span class="pre">blockW</span></code>: filter width. </li>
<li><code class="docutils literal"><span class="pre">strideH</span></code>: stride height. </li>
<li><code class="docutils literal"><span class="pre">strideW</span></code>: stride width. </li>
<li><code class="docutils literal"><span class="pre">paddingH</span></code>: padding height. </li>
<li><code class="docutils literal"><span class="pre">paddingW</span></code>: padding width. </li>
<li><code class="docutils literal"><span class="pre">outputH</span></code>: output height. </li>
<li><code class="docutils literal"><span class="pre">outputW</span></code>: output width. </li>
<li><code class="docutils literal"><span class="pre">dataCol</span></code>: expand data. </li>
Y
Yu Yang 已提交
127 128 129 130 131 132 133
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
134 135
<dt id="_CPPv218hl_maxpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4realKi">
<span id="hl_maxpool_forward__iC.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.realP.iC"></span><span class="target" id="paddlehl__cnn_8h_1af1c5fcb7f4b141cdbb210f9be101b158"></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>, <em class="property">const</em> int <em>tgtStride</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_maxpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4realKi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
136 137 138
<dd><p>Maximum pool forward. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">frameCnt</span></code>: batch size of input image. </li>
<li><code class="docutils literal"><span class="pre">inputData</span></code>: input data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">pooledH</span></code>: output image height. </li>
<li><code class="docutils literal"><span class="pre">pooledW</span></code>: output image width. </li>
<li><code class="docutils literal"><span class="pre">sizeX</span></code>: width of pooling window. </li>
<li><code class="docutils literal"><span class="pre">sizeY</span></code>: height of pooling window. </li>
<li><code class="docutils literal"><span class="pre">strideH</span></code>: pooling stride height. </li>
<li><code class="docutils literal"><span class="pre">strideW</span></code>: pooling stride width. </li>
<li><code class="docutils literal"><span class="pre">paddingH</span></code>: padding height. </li>
<li><code class="docutils literal"><span class="pre">paddingW</span></code>: padding width. </li>
<li><code class="docutils literal"><span class="pre">tgtData</span></code>: output data. </li>
<li><code class="docutils literal"><span class="pre">tgtStride</span></code>: stride between output data samples. </li>
Y
Yu Yang 已提交
155 156 157 158 159 160 161
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
162 163
<dt id="_CPPv219hl_maxpool_backwardKiPK4realPK4realPK4realKiKiKiKiKiKiKiKiKiKiKi4real4realP4realKi">
<span id="hl_maxpool_backward__iC.realCP.realCP.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.real.real.realP.iC"></span><span class="target" id="paddlehl__cnn_8h_1a3a66e636522b79d18690c36d0ee6232b"></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>, <em class="property">const</em> int <em>outStride</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_maxpool_backwardKiPK4realPK4realPK4realKiKiKiKiKiKiKiKiKiKiKi4real4realP4realKi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
164 165 166
<dd><p>Maximum pool backward. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">frameCnt</span></code>: batch size of input image. </li>
<li><code class="docutils literal"><span class="pre">inputData</span></code>: input data. </li>
<li><code class="docutils literal"><span class="pre">outData</span></code>: output data. </li>
<li><code class="docutils literal"><span class="pre">outGrad</span></code>: output grad data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">pooledH</span></code>: output image height. </li>
<li><code class="docutils literal"><span class="pre">pooledW</span></code>: output image width. </li>
<li><code class="docutils literal"><span class="pre">sizeX</span></code>: width of pooling window. </li>
<li><code class="docutils literal"><span class="pre">sizeY</span></code>: height of pooling window. </li>
<li><code class="docutils literal"><span class="pre">strideH</span></code>: pooling stride height. </li>
<li><code class="docutils literal"><span class="pre">strideW</span></code>: pooling stride width. </li>
<li><code class="docutils literal"><span class="pre">scaleA</span></code>: scale. </li>
<li><code class="docutils literal"><span class="pre">scaleB</span></code>: scale. </li>
<li><code class="docutils literal"><span class="pre">paddingH</span></code>: padding height. </li>
<li><code class="docutils literal"><span class="pre">paddingW</span></code>: padding width. </li>
<li><code class="docutils literal"><span class="pre">targetGrad</span></code>: output grad. </li>
<li><code class="docutils literal"><span class="pre">outStride</span></code>: stride between output data samples. </li>
Y
Yu Yang 已提交
187 188 189 190 191 192 193
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
194 195
<dt id="_CPPv218hl_avgpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4realKi">
<span id="hl_avgpool_forward__iC.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.iC.realP.iC"></span><span class="target" id="paddlehl__cnn_8h_1a6523c7d3735308d0e75c4eecc3bc3686"></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>, <em class="property">const</em> int <em>tgtStride</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv218hl_avgpool_forwardKiPK4realKiKiKiKiKiKiKiKiKiKiKiP4realKi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
196 197 198
<dd><p>Averge pool forward. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">frameCnt</span></code>: batch size of input image. </li>
<li><code class="docutils literal"><span class="pre">inputData</span></code>: input data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">pooledH</span></code>: output image height. </li>
<li><code class="docutils literal"><span class="pre">pooledW</span></code>: output image width. </li>
<li><code class="docutils literal"><span class="pre">sizeX</span></code>: width of pooling window. </li>
<li><code class="docutils literal"><span class="pre">sizeY</span></code>: height of pooling window. </li>
<li><code class="docutils literal"><span class="pre">strideH</span></code>: pooling stride height. </li>
<li><code class="docutils literal"><span class="pre">strideW</span></code>: pooling stride width. </li>
<li><code class="docutils literal"><span class="pre">paddingH</span></code>: padding height. </li>
<li><code class="docutils literal"><span class="pre">paddingW</span></code>: padding width. </li>
<li><code class="docutils literal"><span class="pre">tgtData</span></code>: output data. </li>
<li><code class="docutils literal"><span class="pre">tgtStride</span></code>: stride between output data samples. </li>
Y
Yu Yang 已提交
215 216 217 218 219 220 221
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
222 223
<dt id="_CPPv219hl_avgpool_backwardKiPK4realKiKiKiKiKiKiKiKiKiii4real4realP4realKi">
<span id="hl_avgpool_backward__iC.realCP.iC.iC.iC.iC.iC.iC.iC.iC.iC.i.i.real.real.realP.iC"></span><span class="target" id="paddlehl__cnn_8h_1a87e42a661175689be2b5aef36759340b"></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>, <em class="property">const</em> int <em>outStride</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_avgpool_backwardKiPK4realKiKiKiKiKiKiKiKiKiii4real4realP4realKi" title="Permalink to this definition"></a></dt>
Y
Yu Yang 已提交
224 225 226
<dd><p>Maximum pool backward. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">frameCnt</span></code>: batch size of input image. </li>
<li><code class="docutils literal"><span class="pre">outGrad</span></code>: output grad data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">pooledH</span></code>: output image height. </li>
<li><code class="docutils literal"><span class="pre">pooledW</span></code>: output image width. </li>
<li><code class="docutils literal"><span class="pre">sizeX</span></code>: width of pooling window. </li>
<li><code class="docutils literal"><span class="pre">sizeY</span></code>: height of pooling window. </li>
<li><code class="docutils literal"><span class="pre">strideH</span></code>: pooling stride height. </li>
<li><code class="docutils literal"><span class="pre">strideW</span></code>: pooling stride width. </li>
<li><code class="docutils literal"><span class="pre">paddingH</span></code>: padding height. </li>
<li><code class="docutils literal"><span class="pre">paddingW</span></code>: padding width. </li>
<li><code class="docutils literal"><span class="pre">scaleA</span></code>: scale. </li>
<li><code class="docutils literal"><span class="pre">scaleB</span></code>: scale. </li>
<li><code class="docutils literal"><span class="pre">backGrad</span></code>: output grad. </li>
<li><code class="docutils literal"><span class="pre">outStride</span></code>: stride between output data samples. </li>
Y
Yu Yang 已提交
245 246 247 248 249 250 251 252 253 254 255 256
</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>
257 258 259 260 261 262 263 264 265 266 267
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">frameCnt</span></code>: batch size of input image. </li>
<li><code class="docutils literal"><span class="pre">in</span></code>: input data. </li>
<li><code class="docutils literal"><span class="pre">scale</span></code>: buffer. </li>
<li><code class="docutils literal"><span class="pre">out</span></code>: output data. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">sizeX</span></code>: size. </li>
<li><code class="docutils literal"><span class="pre">alpha</span></code>: scale. </li>
<li><code class="docutils literal"><span class="pre">beta</span></code>: scale. </li>
Y
Yu Yang 已提交
268 269 270 271 272 273 274 275 276 277 278 279
</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>
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 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
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">frameCnt</span></code>: batch size of input image. </li>
<li><code class="docutils literal"><span class="pre">inV</span></code>: input data. </li>
<li><code class="docutils literal"><span class="pre">scale</span></code>: buffer. </li>
<li><code class="docutils literal"><span class="pre">outV</span></code>: output value. </li>
<li><code class="docutils literal"><span class="pre">outDiff</span></code>: output grad. </li>
<li><code class="docutils literal"><span class="pre">inDiff</span></code>: input grad. </li>
<li><code class="docutils literal"><span class="pre">channels</span></code>: number of channel. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: image height. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: image width. </li>
<li><code class="docutils literal"><span class="pre">sizeX</span></code>: size. </li>
<li><code class="docutils literal"><span class="pre">alpha</span></code>: scale. </li>
<li><code class="docutils literal"><span class="pre">beta</span></code>: scale. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv219hl_bilinear_forwardPK4realK6size_tK6size_tK6size_tK6size_tP4realK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="hl_bilinear_forward__realCP.sC.sC.sC.sC.realP.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddlehl__cnn_8h_1a474f29a53948c062e272fac2fd0f9e21"></span>void <code class="descname">hl_bilinear_forward</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>inData</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>inputH</em>, <em class="property">const</em> size_t <em>inputW</em>, real *<em>outData</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>outputH</em>, <em class="property">const</em> size_t <em>outputW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv219hl_bilinear_forwardPK4realK6size_tK6size_tK6size_tK6size_tP4realK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition"></a></dt>
<dd><p>Bilinear interpolation forward. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">inData</span></code>: input value. </li>
<li><code class="docutils literal"><span class="pre">inImgH</span></code>: input image height. </li>
<li><code class="docutils literal"><span class="pre">inImgW</span></code>: input image width. </li>
<li><code class="docutils literal"><span class="pre">inputH</span></code>: input batchSize. </li>
<li><code class="docutils literal"><span class="pre">inputW</span></code>: input image data dim. </li>
<li><code class="docutils literal"><span class="pre">outData</span></code>: output value. </li>
<li><code class="docutils literal"><span class="pre">outImgH</span></code>: output image height. </li>
<li><code class="docutils literal"><span class="pre">outImgW</span></code>: output image width. </li>
<li><code class="docutils literal"><span class="pre">outputH</span></code>: output batchSize. </li>
<li><code class="docutils literal"><span class="pre">outputW</span></code>: output image data dim. </li>
<li><code class="docutils literal"><span class="pre">numChannels</span></code>: number of channels. </li>
<li><code class="docutils literal"><span class="pre">ratioH</span></code>: inImgH / outImgH. </li>
<li><code class="docutils literal"><span class="pre">ratioW</span></code>: inImgW / outImgW. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv220hl_bilinear_backwardP4realK6size_tK6size_tK6size_tK6size_tPK4realK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="hl_bilinear_backward__realP.sC.sC.sC.sC.realCP.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddlehl__cnn_8h_1af00417938c6ed2594d92df687b9a168e"></span>void <code class="descname">hl_bilinear_backward</code><span class="sig-paren">(</span>real *<em>inGrad</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>inputH</em>, <em class="property">const</em> size_t <em>inputW</em>, <em class="property">const</em> real *<em>outGrad</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>outputH</em>, <em class="property">const</em> size_t <em>outputW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv220hl_bilinear_backwardP4realK6size_tK6size_tK6size_tK6size_tPK4realK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition"></a></dt>
<dd><p>Bilinear interpolation backward. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">inGrad</span></code>: input gradient. </li>
<li><code class="docutils literal"><span class="pre">inImgH</span></code>: input image height. </li>
<li><code class="docutils literal"><span class="pre">inImgW</span></code>: input image width. </li>
<li><code class="docutils literal"><span class="pre">inputH</span></code>: input batchSize. </li>
<li><code class="docutils literal"><span class="pre">inputW</span></code>: input image data dim. </li>
<li><code class="docutils literal"><span class="pre">outGrad</span></code>: output gradient. </li>
<li><code class="docutils literal"><span class="pre">outImgH</span></code>: output image height. </li>
<li><code class="docutils literal"><span class="pre">outImgW</span></code>: output image width. </li>
<li><code class="docutils literal"><span class="pre">outputH</span></code>: output batchSize. </li>
<li><code class="docutils literal"><span class="pre">outputW</span></code>: output image data dim. </li>
<li><code class="docutils literal"><span class="pre">numChannels</span></code>: number of channels. </li>
<li><code class="docutils literal"><span class="pre">ratioH</span></code>: inImgH / outImgH. </li>
<li><code class="docutils literal"><span class="pre">ratioW</span></code>: inImgW / outImgW. </li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<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 simple">
<li><code class="docutils literal"><span class="pre">inData</span></code>: input data. </li>
<li><code class="docutils literal"><span class="pre">outData</span></code>: output data. </li>
<li><code class="docutils literal"><span class="pre">idData</span></code>: output maxId. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: batchSize. </li>
<li><code class="docutils literal"><span class="pre">size</span></code>: number of channels * image height * image width. </li>
<li><code class="docutils literal"><span class="pre">featLen</span></code>: feature length = image height * image width. </li>
<li><code class="docutils literal"><span class="pre">groups</span></code>: number of groups. </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 simple">
<li><code class="docutils literal"><span class="pre">inGrad</span></code>: input grad data. </li>
<li><code class="docutils literal"><span class="pre">outGrad</span></code>: output grad data. </li>
<li><code class="docutils literal"><span class="pre">idData</span></code>: output maxId. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: batchSize. </li>
<li><code class="docutils literal"><span class="pre">size</span></code>: number of channels * image height * image width. </li>
<li><code class="docutils literal"><span class="pre">featLen</span></code>: feature length = image height * image width. </li>
<li><code class="docutils literal"><span class="pre">groups</span></code>: number of groups. </li>
Y
Yu Yang 已提交
385 386 387 388 389 390 391
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
392
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409
<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>
410
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
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
<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">
457
<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>
458
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
459 460 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
<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>

503
<div class="breathe-sectiondef docutils container">
504 505 506 507 508 509
<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>

510
</div>
511
<div class="breathe-sectiondef docutils container">
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<span class="target" id="paddlehl__device__functions_8cuh_1a2f77ce65914372b51272af85ba285061"></span><code class="descname">__device__ __forceinline__ void simpleReduce(real * smem, int tid, int threads)</code></dt>
<dd><p>sum reduction </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>smem[0]: the sum of each elements in smem. </dd>
<dt><strong>Parameters</strong></dt>
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">smem</span></code>: input data, better to use <strong>shared</strong> memory. </li>
<li><code class="docutils literal"><span class="pre">tid</span></code>: thread index. </li>
<li><code class="docutils literal"><span class="pre">threads</span></code>: the total thread number used to reduce, such as, blockDim.x.</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

531 532
</div>
<dl class="type">
533 534
<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>
535
<dd><div class="breathe-sectiondef docutils container">
536 537 538
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
<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>
556 557 558 559 560
<dd></dd></dl>

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

561
<div class="breathe-sectiondef docutils container">
562 563 564 565 566 567 568
<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 已提交
569 570 571
</div>
<div class="section" id="activation-functions">
<h2>Activation Functions<a class="headerlink" href="#activation-functions" title="Permalink to this headline"></a></h2>
572
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
573 574 575 576 577 578 579 580 581
<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">
582 583
<dt>
<span class="target" id="paddlenamespacehppl"></span><em class="property">namespace </em><code class="descname">hppl</code></dt>
Y
Yu Yang 已提交
584 585 586 587 588 589
<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>
590
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
591 592
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
593 594 595 596
<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 已提交
597 598 599
<dd></dd></dl>

<dl class="type">
600 601 602 603
<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 已提交
604 605 606 607 608 609 610 611
<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>
612
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631
<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>
632
<div class="breathe-sectiondef docutils container">
633 634 635 636 637 638 639
<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>
640
<div class="breathe-sectiondef docutils container">
641 642 643 644 645 646 647 648 649
<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>
650 651 652 653 654 655 656
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">op</span></code>: hl_lstm_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: <a class="reference internal" href="../utils/utils.html#paddlestructhl__lstm__value"><span class="std std-ref">hl_lstm_value</span></a> type. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type. </li>
657 658 659 660 661 662 663 664 665 666 667 668 669 670
</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>
671 672 673 674 675 676 677 678
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">op</span></code>: hl_lstm_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: lstm value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: output gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type. </li>
679 680 681 682 683 684 685 686 687 688 689 690 691 692
</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>
693 694 695 696 697 698 699 700
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">op</span></code>: hl_lstm_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: lstm value. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type. </li>
701 702 703 704 705 706 707 708 709 710 711 712 713 714
</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>
715 716 717 718 719 720 721 722 723
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">op</span></code>: hl_lstm_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: lstm value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: lstm gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type. </li>
724 725 726 727 728 729 730 731 732 733 734 735 736 737
</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>
738 739 740 741 742 743 744 745
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opResetOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opFinalOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
746 747 748 749 750 751 752 753 754 755 756 757 758 759
</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>
760 761 762 763 764 765 766 767 768
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opStateGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opResetGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: gru gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
769 770 771 772 773 774 775 776 777 778 779 780 781 782
</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>
783 784 785 786 787 788 789 790
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opResetOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opFinalOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
791 792 793 794 795 796 797 798 799 800 801 802 803 804
</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>
805 806 807 808 809 810 811 812 813
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opStateGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opResetGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: gru gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
814 815 816 817 818 819 820
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
821
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
822 823 824 825 826 827 828
<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>
829 830 831 832 833 834 835
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">input</span></code>: each sequence contains some instances. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index.. </li>
<li><code class="docutils literal"><span class="pre">output</span></code>: max instance in this sequence. </li>
<li><code class="docutils literal"><span class="pre">index</span></code>: index of max instance. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: size of sequence[in]. </li>
<li><code class="docutils literal"><span class="pre">dim</span></code>: input dimension. </li>
Y
Yu Yang 已提交
836 837 838 839 840 841 842 843 844 845 846 847
</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>
848 849 850 851 852 853
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">outputGrad</span></code>: output gradient. </li>
<li><code class="docutils literal"><span class="pre">index</span></code>: index of max instance. </li>
<li><code class="docutils literal"><span class="pre">inputGrad</span></code>: input gradient. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: size of sequence[in]. </li>
<li><code class="docutils literal"><span class="pre">dim</span></code>: input dimension. </li>
Y
Yu Yang 已提交
854 855 856 857 858 859 860 861 862 863 864 865
</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>
866 867 868 869 870 871 872 873 874 875 876
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">input</span></code>: input sequence. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index. </li>
<li><code class="docutils literal"><span class="pre">weightData</span></code>: padding data. </li>
<li><code class="docutils literal"><span class="pre">output</span></code>: output sequence. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: number of sequences. </li>
<li><code class="docutils literal"><span class="pre">inputDim</span></code>: input sequence dimension. </li>
<li><code class="docutils literal"><span class="pre">contextLength</span></code>: context length. </li>
<li><code class="docutils literal"><span class="pre">contextStart</span></code>: context start. </li>
<li><code class="docutils literal"><span class="pre">beginPad</span></code>: number of extra timesteps added at the beginning. </li>
<li><code class="docutils literal"><span class="pre">isPadding</span></code>: trainable padding. </li>
Y
Yu Yang 已提交
877 878 879 880 881 882 883 884 885 886 887 888
</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>
889 890 891 892 893 894 895 896
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">outputGrad</span></code>: output gradient. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index. </li>
<li><code class="docutils literal"><span class="pre">inputGrad</span></code>: input gradient. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: number of sequences. </li>
<li><code class="docutils literal"><span class="pre">inputDim</span></code>: input sequence dimension. </li>
<li><code class="docutils literal"><span class="pre">contextLength</span></code>: context length. </li>
<li><code class="docutils literal"><span class="pre">contextStart</span></code>: context start. </li>
Y
Yu Yang 已提交
897 898 899 900 901 902 903 904 905 906 907 908
</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>
909 910 911 912 913 914 915 916 917 918
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">outputGrad</span></code>: output gradient. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index. </li>
<li><code class="docutils literal"><span class="pre">weightGrad</span></code>: weight gradient. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: number of sequences. </li>
<li><code class="docutils literal"><span class="pre">weightDim</span></code>: input sequence dimension. </li>
<li><code class="docutils literal"><span class="pre">totalPad</span></code>: number of extra timesteps. </li>
<li><code class="docutils literal"><span class="pre">contextLength</span></code>: context length. </li>
<li><code class="docutils literal"><span class="pre">contextStart</span></code>: context start. </li>
<li><code class="docutils literal"><span class="pre">beginPad</span></code>: number of extra timesteps added at the beginning. </li>
Y
Yu Yang 已提交
919 920 921 922 923 924 925
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
926 927
<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 已提交
928 929 930 931 932 933 934
<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>
935 936 937 938 939 940 941
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batch</span></code>: batch matrix. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: equence matrix. </li>
<li><code class="docutils literal"><span class="pre">batchIndex</span></code>: index vector. </li>
<li><code class="docutils literal"><span class="pre">seqWidth</span></code>: width of sequence. </li>
<li><code class="docutils literal"><span class="pre">batchCount</span></code>: number of batchIndex. </li>
<li><code class="docutils literal"><span class="pre">seq2batch</span></code>: copy direction. </li>
Y
Yu Yang 已提交
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957
</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>
958 959 960 961 962 963 964
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batch</span></code>: batch matrix. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: equence matrix. </li>
<li><code class="docutils literal"><span class="pre">batchIndex</span></code>: index vector. </li>
<li><code class="docutils literal"><span class="pre">seqWidth</span></code>: width of sequence. </li>
<li><code class="docutils literal"><span class="pre">batchCount</span></code>: number of batchIndex. </li>
<li><code class="docutils literal"><span class="pre">seq2batch</span></code>: copy direction. </li>
Y
Yu Yang 已提交
965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
</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>
980 981 982 983 984 985 986
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">dst</span></code>: destination data. </li>
<li><code class="docutils literal"><span class="pre">src</span></code>: source data. </li>
<li><code class="docutils literal"><span class="pre">starts</span></code>: sequence start positions. </li>
<li><code class="docutils literal"><span class="pre">height</span></code>: height of dst data. </li>
<li><code class="docutils literal"><span class="pre">width</span></code>: width of dst data. </li>
<li><code class="docutils literal"><span class="pre">mode</span></code>: 0: avreage, 1: sum, 2: divide by square root of sequenceLength </li>
Y
Yu Yang 已提交
987 988 989 990 991 992 993 994 995
</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>
996
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
997 998 999 1000 1001 1002 1003 1004 1005
<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>
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">gateValue</span></code>: input value. </li>
<li><code class="docutils literal"><span class="pre">stateValue</span></code>: state value. </li>
<li><code class="docutils literal"><span class="pre">preOutputValue</span></code>: prev output value. </li>
<li><code class="docutils literal"><span class="pre">outputValue</span></code>: output value. </li>
<li><code class="docutils literal"><span class="pre">checkIg</span></code>: bias. </li>
<li><code class="docutils literal"><span class="pre">checkFg</span></code>: bias. </li>
<li><code class="docutils literal"><span class="pre">checkOg</span></code>: bias. </li>
<li><code class="docutils literal"><span class="pre">weight</span></code>: weight. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: number of sequences. </li>
<li><code class="docutils literal"><span class="pre">reversed</span></code>: reverse. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type.</li>
Y
Yu Yang 已提交
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035
</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>
1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">gateValue</span></code>: input value. </li>
<li><code class="docutils literal"><span class="pre">gateGrad</span></code>: input gradient. </li>
<li><code class="docutils literal"><span class="pre">stateValue</span></code>: state value. </li>
<li><code class="docutils literal"><span class="pre">stateGrad</span></code>: state gradient. </li>
<li><code class="docutils literal"><span class="pre">preOutputValue</span></code>: prev output value. </li>
<li><code class="docutils literal"><span class="pre">preOutputGrad</span></code>: prev output gradient. </li>
<li><code class="docutils literal"><span class="pre">outputGrad</span></code>: output gradient. </li>
<li><code class="docutils literal"><span class="pre">checkIg</span></code>: bias. </li>
<li><code class="docutils literal"><span class="pre">checkIgGrad</span></code>: bias gradient. </li>
<li><code class="docutils literal"><span class="pre">checkFg</span></code>: bias. </li>
<li><code class="docutils literal"><span class="pre">checkFgGrad</span></code>: bias gradient. </li>
<li><code class="docutils literal"><span class="pre">checkOg</span></code>: bias. </li>
<li><code class="docutils literal"><span class="pre">checkOgGrad</span></code>: bias gradient. </li>
<li><code class="docutils literal"><span class="pre">weight</span></code>: weight. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: number of sequences. </li>
<li><code class="docutils literal"><span class="pre">reversed</span></code>: reverse. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type.</li>
Y
Yu Yang 已提交
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069
</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>
1070 1071 1072 1073 1074 1075 1076 1077 1078
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">weightGrad</span></code>: weight gradient. </li>
<li><code class="docutils literal"><span class="pre">outputValue</span></code>: output value. </li>
<li><code class="docutils literal"><span class="pre">gateGrad</span></code>: gate gradient. </li>
<li><code class="docutils literal"><span class="pre">sequence</span></code>: sequence index. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: batch size. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: number of sequences. </li>
<li><code class="docutils literal"><span class="pre">reversed</span></code>: reverse. </li>
Y
Yu Yang 已提交
1079 1080 1081 1082 1083 1084 1085
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1086
<div class="breathe-sectiondef docutils container">
1087 1088 1089 1090 1091 1092 1093
<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>
1094
<div class="breathe-sectiondef docutils container">
1095 1096 1097 1098 1099 1100 1101 1102 1103
<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>
1104 1105 1106 1107 1108 1109 1110 1111
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">op</span></code>: hl_lstm_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: lstm value. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type. </li>
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
</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>
1126 1127 1128 1129 1130 1131 1132 1133 1134
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">op</span></code>: hl_lstm_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: lstm value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: lstm gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
<li><code class="docutils literal"><span class="pre">active_state</span></code>: actvie gate type. </li>
1135 1136 1137 1138 1139 1140 1141
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1142
<div class="breathe-sectiondef docutils container">
1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163
<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>
1164
<dd><div class="breathe-sectiondef docutils container">
1165 1166 1167 1168 1169 1170
<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>
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">valueIn</span></code>: input </li>
<li><code class="docutils literal"><span class="pre">valueIg</span></code>: input gate </li>
<li><code class="docutils literal"><span class="pre">valueFg</span></code>: forget gate </li>
<li><code class="docutils literal"><span class="pre">valueOg</span></code>: output gate </li>
<li><code class="docutils literal"><span class="pre">gradIn</span></code>: input grad </li>
<li><code class="docutils literal"><span class="pre">gradIg</span></code>: input gate grad </li>
<li><code class="docutils literal"><span class="pre">gradFg</span></code>: forget gate grad </li>
<li><code class="docutils literal"><span class="pre">gradOg</span></code>: output gate grad </li>
<li><code class="docutils literal"><span class="pre">prevState</span></code>: previous state value </li>
<li><code class="docutils literal"><span class="pre">prevStateGrad</span></code>: previous state grad </li>
<li><code class="docutils literal"><span class="pre">state</span></code>: current state value </li>
<li><code class="docutils literal"><span class="pre">stateGrad</span></code>: current state grad </li>
<li><code class="docutils literal"><span class="pre">stateAtv</span></code>: state active </li>
<li><code class="docutils literal"><span class="pre">outputGrad</span></code>: output grad </li>
<li><code class="docutils literal"><span class="pre">checkI</span></code>: check input gate </li>
<li><code class="docutils literal"><span class="pre">checkF</span></code>: check forget gate </li>
<li><code class="docutils literal"><span class="pre">checkO</span></code>: check output gate </li>
<li><code class="docutils literal"><span class="pre">checkIGrad</span></code>: check input gate grad </li>
<li><code class="docutils literal"><span class="pre">checkFGrad</span></code>: check forget gate grad </li>
<li><code class="docutils literal"><span class="pre">checkOGrad</span></code>: check output gate grad </li>
<li><code class="docutils literal"><span class="pre">actInput</span></code>: backward function of input </li>
<li><code class="docutils literal"><span class="pre">actGate</span></code>: backward function of gate </li>
<li><code class="docutils literal"><span class="pre">actState</span></code>: backward function of state </li>
1195 1196 1197 1198 1199 1200 1201
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1202
<div class="breathe-sectiondef docutils container">
1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219
<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>
1220
<dd><div class="breathe-sectiondef docutils container">
1221 1222 1223 1224 1225 1226
<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>
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">valueIn</span></code>: input </li>
<li><code class="docutils literal"><span class="pre">valueIg</span></code>: input gate </li>
<li><code class="docutils literal"><span class="pre">valueFg</span></code>: forget gate </li>
<li><code class="docutils literal"><span class="pre">valueOg</span></code>: output gate </li>
<li><code class="docutils literal"><span class="pre">prevState</span></code>: previous state </li>
<li><code class="docutils literal"><span class="pre">state</span></code>: current state </li>
<li><code class="docutils literal"><span class="pre">stateAtv</span></code>: state active </li>
<li><code class="docutils literal"><span class="pre">output</span></code>: output </li>
<li><code class="docutils literal"><span class="pre">checkI</span></code>: check input gate </li>
<li><code class="docutils literal"><span class="pre">checkF</span></code>: check forget gate </li>
<li><code class="docutils literal"><span class="pre">checkO</span></code>: check output gate </li>
<li><code class="docutils literal"><span class="pre">actInput</span></code>: forward function of input </li>
<li><code class="docutils literal"><span class="pre">actGate</span></code>: forward function of gate </li>
<li><code class="docutils literal"><span class="pre">actState</span></code>: forward function of state </li>
1242 1243 1244 1245 1246 1247 1248
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1249
<div class="breathe-sectiondef docutils container">
1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
<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>
1266
<div class="breathe-sectiondef docutils container">
1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287
<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>
1288
<dd><div class="breathe-sectiondef docutils container">
1289 1290 1291 1292 1293 1294
<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>
1295 1296 1297 1298 1299 1300 1301 1302 1303
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">valueUpdateGate</span></code>: update gate value </li>
<li><code class="docutils literal"><span class="pre">gradUpdateGate</span></code>: update gate grad </li>
<li><code class="docutils literal"><span class="pre">valueFrameState</span></code>: frame state value </li>
<li><code class="docutils literal"><span class="pre">gradFrameState</span></code>: frame state grad </li>
<li><code class="docutils literal"><span class="pre">valuePrevOut</span></code>: previous output value </li>
<li><code class="docutils literal"><span class="pre">gradPrevOut</span></code>: previous output grad </li>
<li><code class="docutils literal"><span class="pre">gradOutput</span></code>: output grad </li>
<li><code class="docutils literal"><span class="pre">actInput</span></code>: backward function of frame state </li>
1304 1305 1306 1307 1308 1309 1310
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1311
<div class="breathe-sectiondef docutils container">
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323
<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>
1324
<dd><div class="breathe-sectiondef docutils container">
1325 1326 1327 1328 1329 1330
<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>
1331 1332 1333 1334 1335 1336 1337 1338 1339
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">valueUpdateGate</span></code>: update gate value </li>
<li><code class="docutils literal"><span class="pre">gradUpdateGate</span></code>: update gate grad </li>
<li><code class="docutils literal"><span class="pre">valueResetGate</span></code>: reset gate value </li>
<li><code class="docutils literal"><span class="pre">gradResetGate</span></code>: reset gate grad </li>
<li><code class="docutils literal"><span class="pre">valuePrevOut</span></code>: previous output value </li>
<li><code class="docutils literal"><span class="pre">gradPrevOut</span></code>: previous output grad </li>
<li><code class="docutils literal"><span class="pre">gradResetOutput</span></code>: reset output grad (temp val) </li>
<li><code class="docutils literal"><span class="pre">actGate</span></code>: backward function of gate </li>
1340 1341 1342 1343 1344 1345 1346
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1347
<div class="breathe-sectiondef docutils container">
1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364
<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>
1365
<dd><div class="breathe-sectiondef docutils container">
1366 1367 1368 1369 1370 1371
<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>
1372 1373 1374 1375 1376 1377
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">valueUpdateGate</span></code>: update gate </li>
<li><code class="docutils literal"><span class="pre">valueResetGate</span></code>: reset gate </li>
<li><code class="docutils literal"><span class="pre">prevOut</span></code>: previous output </li>
<li><code class="docutils literal"><span class="pre">valueResetOutput</span></code>: intermediate value for frame state </li>
<li><code class="docutils literal"><span class="pre">actGate</span></code>: forward function of gate </li>
1378 1379 1380 1381 1382 1383 1384
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1385
<div class="breathe-sectiondef docutils container">
1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397
<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>
1398
<dd><div class="breathe-sectiondef docutils container">
1399 1400 1401 1402 1403 1404
<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>
1405 1406 1407 1408 1409 1410
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">valueUpdateGate</span></code>: update gate </li>
<li><code class="docutils literal"><span class="pre">valueFrameState</span></code>: frame state ({{h}_t}) </li>
<li><code class="docutils literal"><span class="pre">prevOut</span></code>: previous output </li>
<li><code class="docutils literal"><span class="pre">valueOutput</span></code>: output </li>
<li><code class="docutils literal"><span class="pre">actInput</span></code>: forward function of node </li>
1411 1412 1413 1414 1415 1416 1417
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1418
<div class="breathe-sectiondef docutils container">
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431
<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>

1432
<div class="breathe-sectiondef docutils container">
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444
<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>
1445
<div class="breathe-sectiondef docutils container">
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
<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>
1497 1498 1499 1500 1501 1502 1503 1504
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opResetOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opFinalOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
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
</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>
1561 1562 1563 1564 1565 1566 1567 1568 1569
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opStateGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opResetGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: gru gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
1570 1571 1572 1573 1574 1575 1576
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
1577
<div class="breathe-sectiondef docutils container">
1578 1579 1580 1581 1582 1583 1584
<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>
1585
<div class="breathe-sectiondef docutils container">
1586 1587 1588 1589 1590 1591 1592 1593 1594
<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>
1595 1596 1597 1598 1599 1600 1601 1602
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opResetOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opFinalOutput</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616
</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>
1617 1618 1619 1620 1621 1622 1623 1624 1625
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">opStateGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">opResetGrad</span></code>: hl_gru_ops.cuh </li>
<li><code class="docutils literal"><span class="pre">value</span></code>: gru value. </li>
<li><code class="docutils literal"><span class="pre">grad</span></code>: gru gradient. </li>
<li><code class="docutils literal"><span class="pre">frameSize</span></code>: frame length/size. </li>
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: size of current batch. </li>
<li><code class="docutils literal"><span class="pre">active_node</span></code>: active input type. </li>
<li><code class="docutils literal"><span class="pre">active_gate</span></code>: active state type. </li>
1626 1627 1628 1629 1630 1631
</ul>
</dd>
</dl>
</p>
</dd></dl>

Y
Yu Yang 已提交
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
</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">
1673 1674
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698
      <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>
1699 1700 1701
        <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 已提交
1702 1703 1704
      </ul>
    </div>
    <div class="footer" role="contentinfo">
1705
        &#169; Copyright 2016, PaddlePaddle developers.
1706
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
Y
Yu Yang 已提交
1707 1708 1709
    </div>
  </body>
</html>