[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:ft=sigm(Wf[ht1,xt]+bf)it=sigm(Wi[ht1,xt]+bi)ot=sigm(Wo[ht1,xt]+bo)c~t=tanh(Wc[ht1,xt]+bc)ct=ftct1+itc~tcot=tanh(ct)ht=otcotf_t =sigm(W_f[h_{t-1}, x_t] + b_f)\\ i_t =sigm(W_i[h_{t-1}, x_t] + b_i)\\ o_t =sigm(W_o[h_{t-1}, x_t] + b_o)\\ \tilde{c}_t =tanh(W_c[h_{t-1}, x_t] + b_c)\\ c_t =f_t ⊙ c_{t-1} + i_t ⊙ \tilde{c}_t\\ c_{o}^{t} =tanh(c_t)\\ h_t =o_t ⊙ c_{o}^{t}\\
    • 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, aclnnBidirectionLSTMGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBidirectionLSTM is called to perform computation.

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

    [object Object]
  • Returns:

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

The first-phase API implements input parameter verification. The following errors may be thrown:

[object Object][object Object]
  • Parameters:

    [object Object]
  • Returns:

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

[object Object]
  • Deterministic compute:
    • aclnnBidirectionLSTM defaults to a deterministic implementation.
[object Object]

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

[object Object]