qumphy.models.xresnet1d module
File: qumphy/models/xresnet1d.py Project: 22HLT01 QUMPHY Contact: oskar.pfeffer@ptb.de Gitlab: https://gitlab.com/qumphy Description: One-dimensional XResNet and XBotNet model architectures.
- qumphy.models.xresnet1d.BatchNorm(nf, norm_type=NormType.Batch, **kwargs)[source]
Create a batch normalization layer.
- Parameters:
nf (int) – Number of input features.
norm_type (NormType) – Type of batch normalization initialization.
**kwargs – Additional keyword arguments passed to the batch normalization layer.
- Returns:
Initialized batch normalization layer.
- Return type:
nn.Module
- class qumphy.models.xresnet1d.ConvLayer(*args: Any, **kwargs: Any)[source]
Bases:
SequentialOne-dimensional convolutional layer with optional activation and normalization.
- class qumphy.models.xresnet1d.MHSA1d(*args: Any, **kwargs: Any)[source]
Bases:
ModuleMulti-head self-attention block for one-dimensional inputs.
- class qumphy.models.xresnet1d.NormType(value)
Bases:
EnumAn enumeration.
- Batch = 1
- BatchZero = 2
- class qumphy.models.xresnet1d.ResBlock(*args: Any, **kwargs: Any)[source]
Bases:
ModuleResidual block for one-dimensional XResNet models.
- class qumphy.models.xresnet1d.ResBlock_dropout(*args: Any, **kwargs: Any)[source]
Bases:
ModuleResidual block with Monte Carlo dropout for one-dimensional XResNet models.
- class qumphy.models.xresnet1d.XResNet1d(*args: Any, **kwargs: Any)[source]
Bases:
SequentialConfigurable one-dimensional XResNet model.
- get_layer_groups()[source]
Get layer groups of the model.
- Returns:
Tuple containing selected feature layers and the model head.
- Return type:
tuple
- class qumphy.models.xresnet1d.XResNet1d101(*args: Any, **kwargs: Any)[source]
Bases:
XResNet1dXResNet1d-101 model.
- class qumphy.models.xresnet1d.XResNet1d50(*args: Any, **kwargs: Any)[source]
Bases:
XResNet1dXResNet1d-50 model.
- qumphy.models.xresnet1d.init_cnn(m)[source]
Initialize CNN module weights recursively.
- Parameters:
m (nn.Module) – Module whose children should be initialized.
- Returns:
The function modifies the module weights in place.
- Return type:
None
- qumphy.models.xresnet1d.init_default(m, func=torch.nn.init.kaiming_normal_)[source]
Initialize module weights and bias.
- Parameters:
m (nn.Module) – Module whose weights and bias should be initialized.
func (callable) – Initialization function applied to the module weights.
- Returns:
Initialized module.
- Return type:
nn.Module
- qumphy.models.xresnet1d.xbotnet1d101(**kwargs)[source]
Create an XBotNet1d-101 model with multi-head self-attention.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XBotNet1d-101 model.
- Return type:
- qumphy.models.xresnet1d.xbotnet1d152(**kwargs)[source]
Create an XBotNet1d-152 model with multi-head self-attention.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XBotNet1d-152 model.
- Return type:
- qumphy.models.xresnet1d.xbotnet1d50(**kwargs)[source]
Create an XBotNet1d-50 model with multi-head self-attention.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XBotNet1d-50 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d101(**kwargs)[source]
Create an XResNet1d-101 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XResNet1d-101 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d152(**kwargs)[source]
Create an XResNet1d-152 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XResNet1d-152 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d18(**kwargs)[source]
Create an XResNet1d-18 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XResNet1d-18 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d18_deep(**kwargs)[source]
Create a deep XResNet1d-18 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized deep XResNet1d-18 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d18_deeper(**kwargs)[source]
Create a deeper XResNet1d-18 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized deeper XResNet1d-18 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d34(**kwargs)[source]
Create an XResNet1d-34 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XResNet1d-34 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d34_deep(**kwargs)[source]
Create a deep XResNet1d-34 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized deep XResNet1d-34 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d34_deeper(**kwargs)[source]
Create a deeper XResNet1d-34 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized deeper XResNet1d-34 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d50(**kwargs)[source]
Create an XResNet1d-50 model.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XResNet1d-50 model.
- Return type:
- qumphy.models.xresnet1d.xresnet1d50_MCD(**kwargs)[source]
Create an XResNet1d-50 model with Monte Carlo dropout.
- Parameters:
**kwargs – Additional keyword arguments passed to XResNet1d.
- Returns:
Initialized XResNet1d-50 model with Monte Carlo dropout.
- Return type: