Normalization modules

class torch_lattice.nn.modules.norm.BatchNorm(num_features, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True, device=None, dtype=None)[source]

Bases: BatchNorm1d

Parameters:
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.

Return type:

SparseTensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.norm.GroupNorm(num_groups, num_channels, eps=1e-05, affine=True, device=None, dtype=None)[source]

Bases: GroupNorm

Parameters:
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.

Return type:

SparseTensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.norm.InstanceNorm(num_features, eps=1e-05, momentum=0.1, affine=False, track_running_stats=False, device=None, dtype=None)[source]

Bases: InstanceNorm1d

Parameters:
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.

Return type:

SparseTensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.norm.LayerNorm(normalized_shape, eps=1e-05, elementwise_affine=True, bias=True, device=None, dtype=None)[source]

Bases: LayerNorm

Parameters:
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.

Return type:

SparseTensor

Parameters:

input (SparseTensor)

class torch_lattice.nn.modules.norm.RMSNorm(normalized_shape, eps=1e-06, elementwise_affine=True, device=None, dtype=None)[source]

Bases: Module

Parameters:
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.

Return type:

SparseTensor

Parameters:

input (SparseTensor)