jactorch.nn.rnn_layers#

Classes

Class GRULayer

class GRULayer[source]#

Bases: RNNLayerBase

__init__(input_dim, hidden_dim, nr_layers, bias=True, batch_first=True, dropout=0, bidirectional=False)#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

extract_last_output(rnn_last_output)#
flatten_parameters()#
forward(input, input_lengths, sorted=False)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

reset_parameters()#
zero_state(input)#
property state_is_tuple#

Class LSTMLayer

class LSTMLayer[source]#

Bases: RNNLayerBase

__init__(input_dim, hidden_dim, nr_layers, bias=True, batch_first=True, dropout=0, bidirectional=False)#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

extract_last_output(rnn_last_output)#
flatten_parameters()#
forward(input, input_lengths, sorted=False)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

reset_parameters()#
zero_state(input)#
property state_is_tuple#

Class RNNLayer

class RNNLayer[source]#

Bases: RNNLayerBase

__init__(input_dim, hidden_dim, nr_layers, bias=True, batch_first=True, dropout=0, bidirectional=False)#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

extract_last_output(rnn_last_output)#
flatten_parameters()#
forward(input, input_lengths, sorted=False)#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

reset_parameters()#
zero_state(input)#
property state_is_tuple#

Class RNNLayerBase

class RNNLayerBase[source]#

Bases: Module

Basic RNN layer. Will be inherited by concreate implementations.

__init__(input_dim, hidden_dim, nr_layers, bias=True, batch_first=True, dropout=0, bidirectional=False)[source]#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

extract_last_output(rnn_last_output)[source]#
flatten_parameters()[source]#
forward(input, input_lengths, sorted=False)[source]#

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

reset_parameters()[source]#
zero_state(input)[source]#
property state_is_tuple#