data
LeNetConfig
extends
ModelConfigLeNetConfig(num_classes: int = 10, in_channels: int = 1, activation: str = 'tanh', pooling: str = 'avg')Configuration for LeNet-5.
activation controls the nonlinearity:
"tanh"— plain . The 1998 paper's squashing function is the scaled (Appendix A), chosen so ; plain tanh is what every modern re-implementation uses and what the shipped weights were trained with."relu"— modern convention
pooling controls the sub-sampling layers:
"avg"— original paper (average pooling / sub-sampling)"max"— modern convention
in_channels defaults to 1 (grayscale). Set to 3 for RGB inputs,
though the canonical use-case is MNIST / single-channel images.
Examples
>>> from lucid.models.vision.lenet._config import LeNetConfig
>>> cfg = LeNetConfig()
>>> cfg.model_type
'lenet'
>>> cfg.num_classes, cfg.in_channels
(10, 1)