Inception-v1

class cv.backbones.InceptionNet_v1.model.Inception(num_classes, in_channels=3)[source]

Bases: Module

Inception-v1 model class based on the architecture proposed in the paper.

This class implements the Inception architecture, including several Inception modules and auxiliary classifiers to improve training performance. It processes input data through multiple branches of convolutional layers, where each branch has a different kernel size to capture features at various receptive fields.

Parameters:
  • num_classes (int) – Number of output classes.

  • in_channels (int, optional) – Number of input channels, typically 3 for RGB (default: 3).

Example

>>> model = Inception(num_classes=1000)
forward(x, phase='validation')[source]

Forward pass through the Inception model.

Parameters:
  • x (Tensor) – Input tensor of shape (batch_size, in_channels, height, width).

  • phase (str, optional) – Phase of model training (‘training’ or ‘validation’) (default: “validation”).

Returns:

In validation phase, returns the final output tensor. In training phase, returns a list containing outputs from auxiliary classifiers and the final output.

Return type:

Tensor or list

Example

>>> output = model(torch.randn(1, 3, 224, 224))  # Example input tensor of shape (batch_size, channels, height, width)