Assignment Guideline and Rubric CPC251
Assignment Guideline and Rubric CPC251
Assignment 1
Overview
This is a group assignment.
This assignment provides you the opportunity to learn low-level TensorFlow programming. In the
assignment, you are given a dataset which can be downloaded from eLearn@USM. You need to
implement the gradient descent algorithm to estimate (train) the weights a neural network
model.
Requirements
Define the following functions.
def loss_fn():
"""
This function calculates the loss function
"""
def sigmoid():
"""
This function calculates the sigmoid function.
"""
def relu():
"""
This function calculates the ReLU function.
"""
def forward():
"""
This function calculates the forward pass (predicts the label).
"""
def train():
"""
This function performs the forward pass, computes the gradient and update the
weights and biases.
"""
def fit():
"""
This function implements the training loop.
"""
Use low-level TensorFlow programming (TensorFlow without Keras).
Create a neural network with a single hidden layer with ReLU activation. You may define your
own number of units in the layer.
Split the given dataset into three training, validation and test with a ratio of 7:1:2.
Use the training set to estimate the weights, the validation set to validate the model and the
test set to evaluate the linear regression model with the estimated weights.
Display the training loss and validation loss values for each epoch of the training loop.
Display the training loss and validation loss against epoch graph (after model training).
Evaluate the neural network model with the estimated weights on the test set and display the
confusion matrix and the classification report.
Document the codes using comments.
Note: Focus on the algorithm implementation (model is learning from the data), not the
accuracy of the model.
Submission requirements
All the outputs (training All the outputs (training All the outputs (training The outputs are not
loss, validation loss, loss, validation loss, loss, validation loss, displayed
graph and model graph and model graph and model
evaluation) are evaluation) are displayed evaluation) are displayed
displayed. with minor mistakes. with major mistakes.
Runtime and Algorithm Executes without errors. Executes without errors. Executes without errors. Does not execute due to 3
error.
The algorithm is correct. The algorithm is correct The algorithm is partially
with minor mistakes. correct. The algorithm is
incorrect.
Efficiency Solution is efficient, easy The code is fairly efficient A logical solution that is A difficult to understand 3
to understand, and without sacrificing easy to follow but it is and inefficient solution.
maintain. readability and not the most efficient.
understanding. Code is huge and
appears
to be patched together.
Documentation The source codes are The source codes are The source codes are The source codes are not 1
well documented and partially documented minimally documented documented and
commented. and commented. and commented commented