pub struct SimpleRecurrentLayerParams {
pub input_vector_size: u64,
pub output_vector_size: u64,
pub activation: Option<ActivationParams>,
pub sequence_output: bool,
pub has_bias_vector: bool,
pub weight_matrix: Option<WeightParams>,
pub recursion_matrix: Option<WeightParams>,
pub bias_vector: Option<WeightParams>,
pub reverse_input: bool,
}Expand description
A simple recurrent layer.
.. code::
y_t = SimpleRecurrentLayer(x_t, y_{t-1})Input
A blob of rank 5, with shape `[Seq, Batch, inputVectorSize, 1, 1]. This represents a sequence of vectors of size inputVectorSize. Output Same rank as the input. Represents a vector of size outputVectorSize``. It is either the final output or a sequence of outputs at all time steps.
- Output Shape:
\[1, Batch, outputVectorSize, 1, 1\], ifsequenceOutput == false - Output Shape:
\[Seq, Batch, outputVectorSize, 1, 1\], ifsequenceOutput == true
This layer is described by the following equation:
.. math::
\boldsymbol{y_t} = f(\mathrm{clip}(W \boldsymbol{x_t} +
R \boldsymbol{y_{t-1}} + b))
Wis a 2-dimensional weight matrix (\[outputVectorSize, inputVectorSize\], row-major)Ris a 2-dimensional recursion matrix (\[outputVectorSize, outputVectorSize\], row-major)bis a 1-dimensional bias vector (\[outputVectorSize\])f()is an activationclip()is a function that constrains values between\[-50.0, 50.0\]
Fields§
§input_vector_size: u64The size of the input vectors.
output_vector_size: u64The size of the output vectors.
activation: Option<ActivationParams>Activations supported are Linear, Sigmoid, Tanh, ReLU, Scaled Tanh (alpha = 1.71, beta = 2/3), Hard sigmoid (alpha = 0.2, beta = 0.5)
The activation function.
sequence_output: boolIf false output is just the result after final state update. If true, output is a sequence, containing outputs at all time steps.
has_bias_vector: boolIf false, no bias is added.
weight_matrix: Option<WeightParams>Weight matrix W.
recursion_matrix: Option<WeightParams>Recursion Weight matrix R.
bias_vector: Option<WeightParams>Bias vector b.
reverse_input: boolIf true, then the node processes the input sequence from right to left
Trait Implementations§
Source§impl Clone for SimpleRecurrentLayerParams
impl Clone for SimpleRecurrentLayerParams
Source§fn clone(&self) -> SimpleRecurrentLayerParams
fn clone(&self) -> SimpleRecurrentLayerParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SimpleRecurrentLayerParams
impl Debug for SimpleRecurrentLayerParams
Source§impl Default for SimpleRecurrentLayerParams
impl Default for SimpleRecurrentLayerParams
Source§impl Message for SimpleRecurrentLayerParams
impl Message for SimpleRecurrentLayerParams
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for SimpleRecurrentLayerParams
impl PartialEq for SimpleRecurrentLayerParams
Source§fn eq(&self, other: &SimpleRecurrentLayerParams) -> bool
fn eq(&self, other: &SimpleRecurrentLayerParams) -> bool
self and other values to be equal, and is used by ==.