How computerhistory/alexnet-source-code works
This is the original 2012 AlexNet/CUDA-convnet codebase: a GPU convolutional-network system for training and evaluating image classifiers. The principal workflow is to configure a model and data provider, prepare image batches, run training or testing through the ConvNet orchestration layer and native backend, and inspect or score predictions. Separate provider implementations cover ImageNet, CIFAR, Flickr, and JPEG inputs; model-layer parsing and prediction inspection are distinct capabilities. Edges are limited to relationships visible in the excerpts or source index; native engine internals are represented without asserting unsampled call paths.
Main entry points: convnet.py ConvNet runner · convnet.cu CUDA model engine · worker.cu GPU workers · shownet.py Prediction inspector
Components 20
Image data
- ImageNet provider
convdata.py - CIFAR provider
convdata_cifar.py - Flickr provider
convdata_flickr.py - JPEG provider
convdata_jpeg.py
Model orchestration
- ConvNet runner
convnet.py - Layer definitions
layer.py - Network configurations
layers
Native compute
- CUDA model engine
src/convnet.cu - GPU workers
src/worker.cu - Layer kernels
src/layer_kernels.cu - Training costs
src/cost.cu - Weights
src/weights.cu - Neuron operations
src/neuron.cu - Learning rates
src/lr.cu - Quantization
src/quantizer.cu - Tree softmax
src/softmaxtree.cu - Multi-softmax
src/multisoftmax.cpp
Evaluation and inspection
- Prediction inspector
shownet.py - Validation averaging
avg-valid.py
Other components
- Researcher
Connections 20
- Researcher → ConvNet runner: configures and runs
- ConvNet runner → Layer definitions: parses layers
convnet.py - ConvNet runner → ImageNet provider: registers provider
convnet.py - ConvNet runner → CIFAR provider: imports provider
convnet.py - ConvNet runner → Flickr provider: imports provider
convnet.py - ConvNet runner → JPEG provider: imports provider
convnet.py - ConvNet runner → CUDA model engine: loads backend
convnet.py - Researcher → Network configurations: selects configuration
- ConvNet runner → GPU workers: dispatches batches
- GPU workers → Layer kernels: runs operations
- CUDA model engine → Training costs: computes objectives
- CUDA model engine → Weights: updates parameters
- CUDA model engine → Neuron operations: computes activations
- CUDA model engine → Learning rates: uses schedules
- CUDA model engine → Quantization: uses quantization
- CUDA model engine → Tree softmax: uses tree objective
- CUDA model engine → Multi-softmax: uses multi-softmax
- Prediction inspector → ConvNet runner: uses model API
shownet.py - Researcher → Prediction inspector: inspects predictions
- Researcher → Validation averaging: scores predictions