docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Constructor LSTM

    LSTM(string, string[], string[], int, RnnDirection, RnnActivation[], float[], float[], float, bool, RnnLayout)

    Initializes and returns an instance of a Long Short-Term Memory Network (LSTM) recurrent layer.

    Declaration
    public LSTM(string name, string[] inputs, string[] outputs, int hiddenSize, RnnDirection direction, RnnActivation[] activations = null, float[] activationAlpha = null, float[] activationBeta = null, float clip = 3.4028235E+38, bool inputForget = false, RnnLayout layout = RnnLayout.SequenceFirst)
    Parameters
    Type Name Description
    string name

    The name to use for the first output tensor of the layer.

    string[] inputs

    The names to use for the input tensors of the layer [X, W, R, (B, sequenceLens, initialH, initialC, P)].

     X is the name of the input sequences tensor.
    
     W is the name of the weights tensor for the gates of the LSTM.
    
     R is the name of the recurrent weights tensor for the gates of the LSTM.
    
     B is the name of the optional bias tensor for the input gate of the LSTM.
    
     sequenceLens is the name of the optional 1D tensor specifying the lengths of the sequences in a batch.
    
     initialH is the name of the optional initial values tensor of the hidden neurons of the LSTM. If this is `null` then 0 is used.
    
     initialC is the name of the optional initial values tensor of the cells of the LSTM. If this is `null` then 0 is used.
    
     P is the name of the optional weight tensor for the peepholes of the LSTM. If this is `null` then 0 is used.///
    
    string[] outputs

    The names for the output tensors of the layer [Y, Y_h, Y_c].

     Y is the name of the concatenated intermediate output values tensor of the hidden neurons.
    
     Y_h is the name of the last output values tensor of the hidden neurons.
    
     Y_c is the name of the last output values tensor of the cells.
    
    int hiddenSize

    The number of neurons in the hidden layer of the LSTM.

    RnnDirection direction

    The direction of the LSTM as an RnnDirection.

    RnnActivation[] activations

    The activation functions of the LSTM as an array of RnnActivation. If this is null then the LSTM uses the corresponding defaults for the given activations.

    float[] activationAlpha

    The alpha values of the activation functions of the LSTM.

     If this is `null` then the LSTM uses [0, 0, 0...].
    
    float[] activationBeta

    The beta values of the activation functions of the LSTM.

     If this is `null` then the LSTM uses the corresponding defaults for the given activations.
    
    float clip

    The cell clip threshold of the LSTM. The default value is float.MaxValue.

    bool inputForget

    Whether to forget the input values in the LSTM. If this is false the input and forget gates are coupled. The default value is false.

    RnnLayout layout

    The layout of the tensors as an RnnLayout. The default value is RnnLayout.SequenceFirst.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)