[object Object][object Object][object Object]undefined
[object Object]
  • Description: Implements the long short-term memory (LSTM) network, which is a special recurrent neural network (RNN) model. Computes the LSTM network, receives the input sequence and initial state, and returns the output sequence and final state.
  • Formula:(1)ft=σ(Wf[ht1,xt]+bf)(2)it=σ(Wi[ht1,xt]+bi)(3)ot=σ(Wo[ht1,xt]+bo)(4)c~t=tanh(Wc[ht1,xt]+bc)(5)ct=ftct1+itc~t(6)cot=tanh(ct)(7)ht=otcot\begin{aligned} (1)\qquad f_t &=\sigma(W_f[h_{t-1}, x_t] + b_f) \\ (2)\qquad i_t &=\sigma(W_i[h_{t-1}, x_t] + b_i) \\ (3)\qquad o_t &=\sigma(W_o[h_{t-1}, x_t] + b_o) \\ (4)\qquad \tilde{c}_t &=tanh(W_c[h_{t-1}, x_t] + b_c) \\ (5)\qquad c_t &=f_t ⊙ c_{t-1} + i_t ⊙ \tilde{c}_t \\ (6)\qquad c_{o}^{t} &=tanh(c_t) \\ (7)\qquad h_t &=o_t ⊙ c_{o}^{t} \\ \end{aligned}
    • xtRdx_t ∈ R^{d}: input vector to the LSTM unit.
    • ft(0,1)hf_t ∈ (0, 1)^{h}: activation vector of the forget gate.
    • it(0,1)hi_t ∈ (0, 1)^{h}: activation vector of the input/update gate.
    • ot(0,1)ho_t ∈ (0, 1)^{h}: activation vector of the output gate.
    • hi(1,1)hh_i ∈ (-1, 1)^{h}: hidden state vector, also known as output vector of the LSTM unit.
    • c~t(1,1)h\tilde{c}_t ∈ (-1, 1)^{h}: cell input activation vector.
    • ctRhc_t ∈ R^{h}: cell state vector.
    • WRh×d,(URh×h)(bRh)W ∈ R^{h×d}, (U ∈ R^{h×h})∩(b ∈ R^{h}): weight matrices and bias vector parameters which need to be learned during training.
[object Object]

Each operator has calls. First, [object Object] is called to obtain the input parameters and compute the required workspace size based on the process. Then, [object Object] is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object][object Object][object Object][object Object]
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic computation:
    • The aclnnLSTM is implemented in deterministic mode by default.
  • All inputs and outputs support the FLOAT16 and FLOAT32 types, and their data types must be the same.
[object Object]

The following example is for reference only. For details, see .

[object Object]