Skip to content
data

InceptionV4Config

extendsModelConfig
InceptionV4Config(num_classes: int = 1000, in_channels: int = 3, dropout: float = 0.2)

Frozen configuration for Inception-v4.

Inception-v4 is a single-size architecture: the paper (Figure 9) defines exactly one network, so this configuration carries only the input / output widths and the head dropout. Every channel count and repeat count inside the body is fixed by the paper.

Parameters

num_classesint= 1000
Width of the classifier head (ImageNet-1k by default).
in_channelsint= 3
Channels of the input image.
dropoutfloat= 0.2
Drop probability applied to the pooled features before the classifier. Figure 9 specifies keep probability 0.8, i.e. a drop probability of 0.2.

Attributes

model_typestr
Registry identifier, "inception_v4".

Notes

This is the TF-Slim Inception-v4 — the network the released checkpoint was trained as — which follows the paper's figures in every channel width and repeat count. One detail is dictated by the released tensors rather than by the drawings: where a figure lists an asymmetric factorised pair (1×71\times7 then 7×17\times1, or 1×31\times3 then 3×13\times1) in one order and TF-Slim builds the other, the TF-Slim order is used, because the checkpoint's weight shapes fix it.

Layout as built (299×299 input):

- Stem (Figure 3):  299×299×3  → 35×35×384
- 4× Inception-A:   35×35×384
- Reduction-A:      35×35×384  → 17×17×1024  (k, l, m, n = 192, 224, 256, 384)
- 7× Inception-B:   17×17×1024
- Reduction-B:      17×17×1024 →  8×8×1536
- 3× Inception-C:    8×8×1536
- AdaptiveAvgPool → Dropout(p=0.2) → Linear(1536, num_classes)

Every convolution is followed by BatchNorm2d(eps=1e-3) (the TF-Slim default) and a ReLU.

Examples

>>> from lucid.models.vision.inception_v4 import InceptionV4Config
>>> cfg = InceptionV4Config()
>>> cfg.model_type
'inception_v4'
>>> cfg.num_classes, cfg.in_channels, cfg.dropout
(1000, 3, 0.2)

Used by 3