Assignment 01 (Due date: Feb. 11, 2024)
Neural Networks
Assignment 01
Due date: Feb. 11, 2024
Multi-Layer Neural Network
The goal of this assignment is to implement a multi-layer neural network model.
To begin this assignment download the Kamangar_01.zip and unzip it in your computer.
 
  • The neural network model in this assignment is a multi-layer of neurons with multiple nodes in each layer.
  • The activation (transfer) function of all the nodes is assumed to be a sigmoid function.
  • Your model weights should include the bias(es).
  • Your code should be vectorized using numpy. DO NOT use any other package or library (other than numpy).
  • DO NOT alter/change the name of the function or the parameters of the function. You may introduce additional functions (helper functions) as needed. All the helper functions should be put in the same file with multi_layer_nn()  function
  • The comments in the multi_layer_nn()  function provide additional information that should help with your implementation.
  • The Assignment_01_tests.py file includes a very minimal set of unit tests for the multi_layer_nn.py file. The assignment grade will be based on your code passing these tests (and other additional tests).
  • You may modify the "Assignment_01_tests.py" to include more tests. You may also add additional tests to help you during development of your code.
  • DO NOT submit the test files file when submitting your Assignment_01
  • DO NOT  submit the python environment files (if you used an environment for your project)
  • You may run these tests using the 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
 
  • Change the name of the file according to the submission guidelines.
  • Create a directory and name it according to the submission guidelines and include your file in that directory.
  • Zip the directory and upload it  to Canvas according to the submission guidelines.