Assignment 01 (Due date: Sept. 22, 2024)
Neural Networks
Assignment 01
Due date: Sept. 22, 2024
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: The neural network model for this assignment is composed of multiple layers of neurons, with several nodes in each layer. The activation (transfer) function for all the nodes will be a sigmoid function.
 
Weights: Your model’s weights should include biases, which are represented in the first column 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 11 items
 
Assignment_01_tests.py::test_can_fit_data_test PASSED                   [  9%]
Assignment_01_tests.py::test_can_fit_data_test_2d PASSED                [ 18%]
Assignment_01_tests.py::test_check_weight_init PASSED                   [ 27%]
Assignment_01_tests.py::test_large_alpha_test PASSED                    [ 36%]
Assignment_01_tests.py::test_small_alpha_test PASSED                    [ 45%]
Assignment_01_tests.py::test_number_of_nodes_test PASSED                [ 54%]
Assignment_01_tests.py::test_check_output_shape PASSED                  [ 63%]
Assignment_01_tests.py::test_check_output_shape_2d PASSED               [ 72%]
Assignment_01_tests.py::test_check_output_values PASSED                 [ 81%]
Assignment_01_tests.py::test_check_weight_update PASSED                 [ 90%]
Assignment_01_tests.py::test_h_value_used PASSED                        [100%]
 
===================== 11 passed in 6.04s ======================================
 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