Cells
RecurrentLayers.RANCell
— TypeRANCell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
The RANCell
, introduced in this paper, is a recurrent cell layer which provides additional memory through the use of gates.
and returns both ht anf ct.
See RAN
for a layer that processes entire sequences.
Arguments
in => out
: Specifies the input and output dimensions of the layer.init
: Initialization function for the weight matrices, default isglorot_uniform
.bias
: Indicates if a bias term is included; the default istrue
.
Forward
rancell(x, [h, c])
The forward pass takes the following arguments:
x
: Input to the cell, which can be a vector of sizein
or a matrix of sizein x batch_size
.h
: The hidden state vector of the cell, sizedout
, or a matrix of sizeout x batch_size
.c
: The candidate state, sizedout
, or a matrix of sizeout x batch_size
.
If not provided, both h
and c
default to vectors of zeros.
Examples
rancell = RANCell(3 => 5)
+ kernel_init = glorot_uniform,
+ recurrent_kernel_init = glorot_uniform,
+ bias = true)
The RANCell
, introduced in this paper, is a recurrent cell layer which provides additional memory through the use of gates.
and returns both ht anf ct.
See RAN
for a layer that processes entire sequences.
Arguments
in => out
: Specifies the input and output dimensions of the layer.init
: Initialization function for the weight matrices, default isglorot_uniform
.bias
: Indicates if a bias term is included; the default istrue
.
Forward
rancell(x, [h, c])
The forward pass takes the following arguments:
x
: Input to the cell, which can be a vector of sizein
or a matrix of sizein x batch_size
.h
: The hidden state vector of the cell, sizedout
, or a matrix of sizeout x batch_size
.c
: The candidate state, sizedout
, or a matrix of sizeout x batch_size
.
If not provided, both h
and c
default to vectors of zeros.
Examples
rancell = RANCell(3 => 5)
inp = rand(Float32, 3)
#initializing the hidden states, if we want to provide them
state = rand(Float32, 5)
@@ -11,34 +11,34 @@
#result with default initialization of internal states
result = rancell(inp)
#result with internal states provided
-result_state = rancell(inp, (state, c_state))
RecurrentLayers.IndRNNCell
— Typefunction IndRNNCell((in, out)::Pair, σ=relu;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.LightRUCell
— TypeLightRUCell((in, out)::Pair, σ=tanh;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.LiGRUCell
— TypeLiGRUCell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.MGUCell
— TypeMGUCell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.NASCell
— TypeNASCell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.RHNCell
— TypeRHNCell((in, out), depth=3; couple_carry::Bool = true, cell_kwargs...)
RecurrentLayers.RHNCellUnit
— TypeRHNCellUnit((in, out)::Pair;
-kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.MUT1Cell
— TypeMUT1Cell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.MUT2Cell
— TypeMUT2Cell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.MUT3Cell
— TypeMUT3Cell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true)
RecurrentLayers.SCRNCell
— Typefunction SCRNCell((in, out)::Pair;
-kernel_init = glorot_uniform,
-recurrent_kernel_init = glorot_uniform,
-bias = true,
-alpha = 0.0)