models package

Subpackages

Submodules

models.backbone_header_model module

class BackboneHeaderModel(backbone: Union[LightningModule, Module], header: Union[LightningModule, Module], backbone_output_layer: Optional[str] = None)[source]

Bases: LightningModule

A generic model class to provide the possibility to create different backbone/header combinations. The backbone and header compatibility can be tested with the callback CheckBackboneHeaderCompatibility during runtime. The loading of the different parts is done in execute.

Parameters:
  • backbone (Union[pl.LightningModule, torch.nn.Module]) – The backbone model

  • header (Union[pl.LightningModule, torch.nn.Module]) – The header model

  • backbone_output_layer (Optional[str]) – The name of the output layer of the backbone. If None, the last layer of the backbone is used.

forward(x)[source]

Same as torch.nn.Module.forward().

Parameters:
  • *args – Whatever you decide to pass into the forward method.

  • **kwargs – Keyword arguments are also possible.

Returns:

Your model’s output

training: bool

Module contents