LeNet-5: Classic CNN for handwritten digit recognition.
LeNet-5: Classic convolutional neural network for handwritten digit recognition.
LeCun et al., 1998: "Gradient-Based Learning Applied to Document Recognition" One of the first successful CNNs, originally designed for MNIST digit classification.
The original paper used average pooling and tanh activation, but modern implementations often use max pooling and ReLU.
Example:
let model = LeNet.create ~config:LeNet.mnist_config () in
let params = Kaun.init model ~rngs ~dtype:Float32 in
let output = Kaun.apply model params ~training:false input in
extract_features ~model ~params ~input extracts feature representations from the second-to-last layer (FC2), useful for transfer learning or visualization. Returns features of shape batch_size; 84.
accuracy ~predictions ~labels computes classification accuracy. Predictions should be logits of shape batch_size; num_classes, labels should be class indices of shape batch_size.