Trait tch::nn::RNN

source ·
pub trait RNN {
    type State;

    fn zero_state(&self, batch_dim: i64) -> Self::State;
    fn step(&self, input: &Tensor, state: &Self::State) -> Self::State;
    fn seq_init(
        &self,
        input: &Tensor,
        state: &Self::State
    ) -> (Tensor, Self::State); fn seq(&self, input: &Tensor) -> (Tensor, Self::State) { ... } }
Expand description

Trait for Recurrent Neural Networks.

Required Associated Types§

Required Methods§

A zero state from which the recurrent network is usually initialized.

Applies a single step of the recurrent network.

The input should have dimensions [batch_size, features].

Applies multiple steps of the recurrent network.

The input should have dimensions [batch_size, seq_len, features].

Provided Methods§

Applies multiple steps of the recurrent network.

The input should have dimensions [batch_size, seq_len, features]. The initial state is the result of applying zero_state.

Implementors§