qumphy.models.alexnet module

File: qumphy/models/alexnet.py Project: 22HLT01 QUMPHY Contact: oskar.pfeffer@ptb.de Gitlab: https://gitlab.com/qumphy Description: Alexnet pytorch lightning model.

class qumphy.models.alexnet.AlexNet1D(*args: Any, **kwargs: Any)[source]

Bases: Module

General 1D AlexNet model implementation.

The input_size and output size can be chosen freely. Minimum input_size is 67.

The input shape is (batch_size, 1, input_size) and the output shape is (batch_size, output_size).

Activation function for the last layer can be chosen freely.

forward(x)[source]

Run a forward pass through the model.

Parameters:

x (torch.Tensor) – Input tensor of shape (batch_size, 1, input_size).

Returns:

Model output tensor of shape (batch_size, output_size).

Return type:

torch.Tensor

class qumphy.models.alexnet.AlexNet1D_MCD(*args: Any, **kwargs: Any)[source]

Bases: Module

General 1D AlexNet model implementation with Monte Carlo dropout.

The input_size and output size can be chosen freely. Minimum input_size is 67.

The input shape is (batch_size, 1, input_size) and the output shape is (batch_size, output_size).

Activation function for the last layer can be chosen freely.

forward(x)[source]

Run a forward pass through the model.

Parameters:

x (torch.Tensor) – Input tensor of shape (batch_size, 1, input_size).

Returns:

Model output tensor of shape (batch_size, output_size).

Return type:

torch.Tensor