jactorch.nn.residual#

Classes

Class ResidualConvBlock

class ResidualConvBlock[source]#

Bases: Module, AutoResetParametersMixin

__init__(inplanes, planes, stride=1, downsample=None)[source]#

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

forward(x)[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.

expansion = 1#

Class ResidualConvBottleneck

class ResidualConvBottleneck[source]#

Bases: Module, AutoResetParametersMixin

__init__(inplanes, planes, stride=1, downsample=None)[source]#

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

forward(x)[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.

expansion = 4#

Class ResidualGRU

class ResidualGRU[source]#

Bases: Module, AutoResetParametersMixin

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

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

forward(input, input_lengths, initial_states=None)[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.

Class ResidualLinear

class ResidualLinear[source]#

Bases: Module, AutoResetParametersMixin

__init__(hidden_dim, norm1=None, norm2=None)[source]#

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

forward(input)[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.