Skip to content
fn

alexnet

→AlexNet2.5M
alexnet(pretrained: bool = False, overrides: object = {})

AlexNet feature-extracting backbone (no fully-connected head).

Builds an AlexNet with the Krizhevsky 2014 single-stream OWT topology: five convolutional blocks (Conv1: 3→64 with 11×1111\times11 stride-4; Conv2: 64→192 with 5×55\times5; Conv3: 192→384, Conv4: 384→256, Conv5: 256→256, all 3×33\times3), and overlapping 3×33\times3 max-pools after blocks 1, 2, 5. Approximately 2.5 M parameters in the convolutional trunk alone (≈61.1 M for the full classifier variant).

Model Size

Parameters

pretrainedbool= False
No checkpoint is published for alexnet, so True raises NotImplementedError rather than return randomly initialised weights. alexnet_cls is the checkpointed variant.
**overridesobject= {}
Keyword overrides forwarded into AlexNetConfig to customise individual fields (in_channels=1 for grayscale, dropout=0.0 to disable the dropout layers of the classifier head).

Returns

AlexNet

Backbone with the AlexNet configuration applied (or with overrides merged on top of it).

Notes

Krizhevsky et al., NIPS 2012 reports a 15.3% ImageNet-1k top-5 validation error — more than ten percentage points below the runner-up — and is widely credited with re-igniting deep-learning research after the 2006-2011 lull. Channel widths follow Krizhevsky 2014 ("One weird trick for parallelizing convolutional neural networks"), the single-stream re-derivation of the original two-GPU model, since that is the topology every published reference checkpoint targets. No paper-cited "small / large" variants exist (H11) — AlexNet is a single architecture.

Examples

>>> import lucid
>>> from lucid.models.vision.alexnet import alexnet
>>> model = alexnet()
>>> x = lucid.randn(1, 3, 224, 224)
>>> out = model(x)
>>> out.last_hidden_state.shape   # (B, 256, 6, 6)
(1, 256, 6, 6)

Used by 1