models.generator.NeckGen#
- class NeckGen(cfg: str | ListGen, in_channels: int = 2, init_weights: bool = False)[source]#
Bases:
ModelGen
Network neck generator
Returns a list of tensors that were stored in the
models.modules.Return
layers.- 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
Stores the format of the output data
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: List[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]