Base Model

class torchok.models.base.BaseModel(in_channels: Optional[Union[int, List[int], Tuple[int, ...]]] = None, out_channels: Optional[Union[int, List[int], Tuple[int, ...]]] = None)

Bases: Module, ABC

Base model for all TorchOk Models - Neck, Pooling and Head.

__init__(in_channels: Optional[Union[int, List[int], Tuple[int, ...]]] = None, out_channels: Optional[Union[int, List[int], Tuple[int, ...]]] = None)

Init BaseModel.

Parameters
  • in_channels – Number of input channels.

  • out_channels – Number of output channels - channels after forward method.

abstract forward(*args, **kwargs) Tensor

Forward method.

no_weight_decay() List[str]

Create module names for which weight decay will not be used.

Returns: Module names for which weight decay will not be used.

property in_channels: Union[int, List[int], Tuple[int, ...]]

Number of input channels.

property out_channels: Union[int, List[int], Tuple[int, ...]]

Number of output channels - channels after forward method.

init_weights()

Initialize model weights

training: bool