models.generator.BackboneGen#
- class BackboneGen(cfg: BaseConfig, in_channels: int = 2, init_weights: bool = True)[source]#
Bases:
ModelGen
Model base generator
Returns the tensor from the last layer of the network.
- Parameters:
cfg (BaseConfig) – Network Configuration Generator.
in_channels (int, optional) – Number of input channels. Defaults to 2.
init_weights (bool, optional) – If
true
apply weight initialization function. Defaults to True.
Methods
Network pass for data containing time resolution
State-based network pass
Attributes
training
- forward(X: Tensor) Tensor [source]#
Network pass for data containing time resolution
- Parameters:
X (torch.Tensor) – Input tensor. Shape is Shape [ts, batch, channel, h, w].
- Returns:
The resulting tensor and the list of new states.
- Return type:
- forward_impl(X: Tensor, state: ListState | None) Tuple[Tensor, ListState] [source]#
State-based network pass
- Parameters:
X (torch.Tensor) – Input tensor. Shape is Shape [batch, channel, h, w].
state (ListState | None, optional) – List of block layer states. Defaults to None.
- Returns:
The resulting tensor and the list of new states.
- Return type:
Tuple[torch.Tensor, ListState]