Introduction
In this lab, you will implement NumPy forward inference and reverse-mode backpropagation for a CIFAR-10 CNN. Complete the inference first, then finish the required backpropagation task.
Lab Overview
Lab Tasks
Complete the TODOs in the provided notebook to implement NumPy forward inference and reverse-mode backpropagation for the CIFAR-10 CNN.
- Implement the required forward operations for ReLU, convolution, max pooling, and fully-connected layers, and complete the CNN inference function.
- Prepare the CIFAR-10 input as required and run inference using the released model weights.
- Implement the required backward operations for the network, including input and weight gradients where applicable.
- Use the provided mean softmax cross-entropy loss function as the starting point for backpropagation.
Grading (100 pts): Forward inference and data preparation: 60 pts. Backpropagation: 40 pts.
Note: The description on this page provides only a summary of the lab. Please refer to the provided IPython notebook for the detailed requirements and instructions.
Lab Files
Download the complete Lab 1 package here: EE219-Lab1.zip
Requirements
Complete the provided EE219-Lab1.ipynb.
- Complete the code independently.
- Make sure your results are reproducible.
- Do not change the CNN structure, starter interfaces, or given code outside the TODOs.
- Do not add libraries beyond the imports provided in the notebook.
Bonus
Calculate the number of computations and parameters. Visualize your results directly in the outputs of your codes.
Submission
Before submitting:
- Complete every required forward and backpropagation TODO.
- Run the notebook from top to bottom and keep the required inference and backpropagation outputs.
- Confirm preprocessing produces
(1, 3, 32, 32)and every returned weight gradient matches its checkpoint tensor's shape. - Submit only the completed
EE219-Lab1.ipynb; do not modify or submit the released checkpoints, CIFAR-10 data, or generated files. - If you use AI, please follow the requirements introduced in class and submit a separate AI report on Gradescope.
Important
Your notebook should be executable from top to bottom and should retain the required outputs when submitted.