How mirl-iitm/da6401_assignment_1 works
Project Type and Purpose
• This is an educational, NumPy-only implementation of a Multi-Layer Perceptron (MLP) for image classification (MNIST/Fashion-MNIST).
• It provides the full training and inference pipeline, including forward/backward propagation, optimizers, loss functions, and experiment logging via Weights & Biases.
File Structure Analysis
Top-level:
• README.md – Describes the assignment and learning objectives
• requirements.txt – Python dependencies (NumPy, wandb, etc.)
• models/ – Directory to save trained model files
• src/
– ann/ – Core neural network library
› activations.py
› neural_layer.py
› neural_network.py
› objective_functions.py
› optimizers.py
– utils/ – Utility modules
› data_loader.py
– train.py – Orchestrates training loop
– inference.py – Loads a saved model and runs predictions
Key Components
a. Data Pipeline
• Data Loader (src/utils/data_loader.py)
• Datasets (MNIST/Fashion-MNIST)
b. Core MLP Library (src/ann)
• Layers (neural_layer.py)
• Activations (activations.py)
• Loss Functions (objective_functions.py)
• Optimizers (optimizers.py)
• Network Orchestration (neural_network.py)
c. Training Orchestrator (src/train.py)
• Loads data → builds the network → runs forward/backward passes → updates weights → logs metrics to Weights & Biases → saves model files to models/
d. Inference Orchestrator (src/inference.py)
• Loads a saved model → loads test data → runs forward pass → outputs predictions
e. External Services
• Weights & Biases for experiment logging
Architectural Patterns and Principles
• Modular Layering: Core library (ann) is isolated from orchestration scripts (train, inference)
• Pipeline Pattern: Clear separation of data loading, model definition, training loop, and inference