AIGS1006 Assignment 2

.pdf

School

Loyalist College *

*We aren’t endorsed by this school

Course

1003

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

3

Uploaded by DeaconMosquito4213

Report
AIGS1006 - Deep Learning Assignment 2 Collaboration Policy After you have thought about the questions on your own, collaboration is strongly encouraged on the assignments and it is also acceptable to get clarification (but not solutions) from books or online resources. Always ensure you cite your collaborators fully and completely (e.g., “Ada explained to me what was asked in part a of Q1”). Furthermore, write your solutions or coding implementations independently. Requirements for submission Submit a single .ipynb file via Canvas (Rename as FirstnameLastName.ipynb). Assignments are to be completed individually, plagiarism will not be tolerated and will result in a mark of 0, at the minimum. This assignment is worth 15% of your final grade. Assignments are marked not only on your ability to solve the questions but also on your attention to detail and ability to follow the instructions. Question 1 [18 points] You are given the neural network in Figure 1. Single-circled nodes denote variables (e.g., x 1 is an input variable, h 1 is an intermediate variable, ˆ y is an output variable), and double-circled nodes denote functions (e.g., takes the sum of its inputs, and σ denotes the logistic function, i.e., σ ( z ) = 1 1+ e z . In Figure 1, h 1 = 1 1+ e w 1 x 1 w 2 x 2 . Suppose you have an L2 loss L ( y, ˆ y ) = || ˆ y y || 2 . You are also given a data point ( x 1 , x 2 , x 3 , x 4 ) = (-0.7, 1.2, 1.1, -2) with true label as 0.5. Use the backpropagation algorithm to compute the partial derivative ∂L ∂w 1 . Note that the gradient of an L2 loss function || ˆ y y || 2 is 2 || ˆ y y || . Show all workings! 1
Figure 1: Neural Network Question 2 [32 points] The goal of this question is to have you use TensorFlow to build some neural network, and to experiment with the options and flexibility that TensorFlow offers. Use TensorFlow to build a feedforward neural network to predict occupancy. It comprises experimental data used for binary classification of room occupancy (i.e., room is empty vs occupied) based on temperature, humidity, light, and CO2 sensors. The training and test data sets are each collected over a week period. The data set includes time stamps with date and hour/minute/second within the day. You are not to use time stamp features for predicting occupancy. Since this is a commercial office building, the time stamp is a strong predictor of occupancy. Rather, the goal is to determine whether occupancy can be sensed from: 1. temperature ( C ) 2. relative humidity (%) 3. light ( lx ) 4. CO2 ( ppm ) 5. humidity ratio (this is derived from the temperature and the relative humidity) The training data included as trainData.txt file and testData.txt is the test data file. 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help