StackedRNN
RecurrentLayers.StackedRNN — TypeStackedRNN(rlayer, (input_size, hidden_size), args...;
num_layers = 1, dropout = 0.0, kwargs...)Constructs a stack of recurrent layers given the recurrent layer type.
Arguments:
rlayer: Any recurrent layer such as MGU, RHN, etc... orFlux.RNN,Flux.LSTM, etc.input_size: Defines the input dimension for the first layer.hidden_size: defines the dimension of the hidden layer.num_layers: The number of layers to stack. Default is 1.dropout: Value of dropout to apply between recurrent layers. Default is 0.0.args...: Additional positional arguments passed to the recurrent layer.
Keyword arguments
kwargs...: Additional keyword arguments passed to the recurrent layers.
Examples
julia> using RecurrentLayers
julia> stac_rnn = StackedRNN(MGU, (3=>5); num_layers = 4)
StackedRNN(
[
MGU(1 => 5), # 100 parameters
MGU(1 => 5), # 120 parameters
MGU(1 => 5), # 120 parameters
MGU(1 => 5), # 120 parameters
],
) # Total: 16 trainable arrays, 460 parameters,
# plus 4 non-trainable, 20 parameters, summarysize 3.055 KiB.