Backends/SiaNet.Backend.MxNet/NDArrayOps.cs
/// <summary>
/// Applies a recurrent layer to input.
/// </summary>
/// <param name="@out">output NDArray</param>
/// <param name="data">Input data to RNN</param>
/// <param name="parameters">Vector of all RNN trainable parameters concatenated</param>
/// <param name="state">initial hidden state of the RNN</param>
/// <param name="state_cell">initial cell state for LSTM networks (only for LSTM)</param>
/// <param name="state_size">size of the state for each layer</param>
/// <param name="num_layers">number of stacked layers</param>
/// <param name="mode">the type of RNN to compute</param>
/// <param name="bidirectional">whether to use bidirectional recurrent layers</param>
/// <param name="p">Dropout probability, fraction of the input that gets dropped out at training time</param>
/// <param name="state_outputs">Whether to have the states as symbol outputs.</param>
/// <returns>returns new symbol</returns>
Applies a recurrent layer to input.
Applies a recurrent layer to input .
public static NDArray RNN(NDArray @out,
        NDArray data,
        NDArray parameters,
        NDArray state,
        NDArray state_cell,
        uint state_size,
        uint num_layers,
        RNNMode mode,
        bool bidirectional = false,
        float p = 0f,
        bool state_outputs = false)
        {
            return new Operator("RNN")
            .SetParam("state_size", state_size)
            .SetParam("num_layers", num_layers)
            .SetParam("bidirectional", bidirectional)
            .SetParam("mode", NDUtil.EnumToString<RNNMode>(mode, RNNModeConvert))
            .SetParam("p", p)
            .SetParam("state_outputs", state_outputs)
            .SetInput("data", data)
            .SetInput("parameters", parameters)
            .SetInput("state", state)
            .SetInput("state_cell", state_cell)
            .Invoke(@out);
        }
public static NDArray RNN ( NDArray @out , NDArray data , NDArray parameters , NDArray state , NDArray state_cell , uint state_size , uint num_layers , RNNMode mode , bool bidirectional = false , float p = 0f , bool state_outputs = false ) { return new Operator ( " " ) . SetParam ( " " , state_size ) . SetParam ( " " , num_layers ) . SetParam ( " " , bidirectional ) . SetParam ( " " , NDUtil . EnumToString < RNNMode > ( mode , RNNModeConvert ) ) . SetParam ( " " , p ) . SetParam ( " " , state_outputs ) . SetInput ( " " , data ) . SetInput ( " " , parameters ) . SetInput ( " " , state ) . SetInput ( " " , state_cell ) . Invoke ( @out ) ; }
Applies a recurrent layer to input.
Applies a recurrent layer to input .
returns new symbol
returns new symbol
@out
NDArray
None
data
NDArray
Input data to RNN
Input data to RNN
parameters
NDArray
Vector of all RNN trainable parameters concatenated
Vector of all RNN trainable parameters concatenated
state
NDArray
initial hidden state of the RNN
initial hidden state of the RNN
state_cell
NDArray
initial cell state for LSTM networks (only for LSTM)
initial cell state for LSTM networks ( only for LSTM )
state_size
uint
size of the state for each layer
size of the state for each layer
num_layers
uint
number of stacked layers
number of stacked layers
mode
RNNMode
the type of RNN to compute
the type of RNN to compute
bidirectional
bool
whether to use bidirectional recurrent layers
whether to use bidirectional recurrent layers
p
float
Dropout probability, fraction of the input that gets dropped out at training time
Dropout probability fraction of the input that gets dropped out at training time
state_outputs
bool
Whether to have the states as symbol outputs.
Whether to have the states as symbol outputs .