lenet_5_cls(pretrained: bool = False, overrides: object = {})LeNet-5 image classifier (C1-S2-C3-S4-C5 + F6 + linear head).
Builds a LeNetForImageClassification with the paper-cited
LeCun 1998 configuration: three convolutions, two sub-sampling
layers, a hidden F6 layer (120 → 84), and a final linear projection
to config.num_classes (default 10 for MNIST). Approximately
60 k parameters total.
Model Size
Parameters
pretrainedbool= FalseReserved for future pretrained-weight loading. Currently
ignored.
**overridesobject= {}Keyword overrides forwarded into
LeNetConfig to
retarget num_classes (e.g. num_classes=100 for
CIFAR-100) or to enable the modern ReLU + max-pool variant via
activation="relu", pooling="max".Returns
LeNetForImageClassificationClassifier with the LeNet-5 configuration applied (or with
overrides merged on top of it).
Notes
See LeCun et al., "Gradient-Based Learning Applied to Document Recognition", Proc. IEEE 86(11):2278–2324, 1998, Figure 2. The canonical MNIST test-set error is 0.95% with the original distortion- augmented training recipe.
Examples
>>> import lucid
>>> from lucid.models.vision.lenet import lenet_5_cls
>>> model = lenet_5_cls()
>>> x = lucid.randn(2, 1, 32, 32)
>>> out = model(x)
>>> out.logits.shape
(2, 10)