3.3 Assignment 01 (Due date: Feb. 8, 2026)
Neural Networks
Assignment 01
Due date: Feb. 8, 2026
Multi-Layer Neural Network
 
The objective of this assignment is to develop a multi-layer neural network model from scratch.
 
Instructions:
Setup: Begin by downloading the  Kamangar_01.zip file and unzipping it on your computer.
 
Model Overview: This assignment uses a multi-layer neural network with sigmoid activations in the hidden layers and a linear activation in the output layer.
 
Weights: Your model’s weights should include biases, which are represented in the first row of your weight matrices.
 
Vectorization: Ensure that your code is fully vectorized using numpy. You are NOT allowed to use any external libraries or packages, except for numpy.
 
Training: Implement the model to update weights after processing each sample (i.e., using a batch size of 1).
 
Function Constraints: You MUST NOT change the name of the primary function (multi_layer_nn) or its parameters. However, you are allowed to add any additional (helper) functions as needed. All helper functions must be included in the same file as the multi_layer_nn() function.
 
Comments & Documentation: Comments in the multi_layer_nn() function provide further guidance to help with your implementation. Follow these comments closely to ensure that your implementation is aligned with the requirements.
 
Testing: A minimal set of unit tests is provided in the Assignment_01_tests.py file to check the functionality of your multi_layer_nn.py. Your grade will depend on passing these tests, as well as additional tests that may be used during grading. Feel free to modify or extend the Assignment_01_tests.py file to include more tests for development purposes.
 
DO NOT submit the test file when submitting your Assignment_01
DO NOT  submit the python environment files (if you used an environment for your project)
 
Running Tests: To run the tests, use the following command:
 
 py.test --verbose Assignment_01_tests.py
 
The following is roughly what your output should look like if all tests pass
 
collected 10 items
 
Assignment_01_tests.py::test_can_fit_data PASSED                           [ 10%]
Assignment_01_tests.py::test_can_fit_data_2d PASSED                    [ 20%]
Assignment_01_tests.py::test_check_weight_init PASSED                 [ 30%]
Assignment_01_tests.py::test_large_alpha_test PASSED                    [ 40%]
Assignment_01_tests.py::test_small_alpha_test PASSED                    [ 50%]
Assignment_01_tests.py::test_number_of_nodes_test PASSED        [ 60%]
Assignment_01_tests.py::test_check_output_shape_2d PASSED      [ 70%]
Assignment_01_tests.py::test_check_output_values PASSED            [ 80%]
Assignment_01_tests.py::test_check_weight_update PASSED           [ 90%]
Assignment_01_tests.py::test_h_value_used PASSED                          [100%]
 
================ 10 passed in 5.67s ============================
 
 Grading Criteria
  • Your submitted function will be tested with multiple test units.
  • Passing the tests - 90 points
  • Qualitative Evaluation - 10 points (Grader may examine your code and subjectively award as many as 10 points.)
 
Submission Guidelines
  • The first four lines of any submitted file must follow the following format according to the assignment submission guidelines.
# Your name (last name, first name)
# Your student ID (100x_xxx_xxx)
# Date of submission (yyyy_mm_dd)
# Assignment_nn_kk