Quiz Space

May 2023 term · Deep Learning · BSCS3004

Deep Learning Quiz 1: 16 July 2023 (May 2023 term)

The IIT Madras BS Deep Learning (Deep Learning) Quiz 1 paper sat on 16 Jul 2023, in the May 2023 term: 14 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
14
Marks
50
Duration
120 min
MSQ
1
MCQ
3
Numerical
10

Updated

Official paper: IIT M DEGREE AN2 EXAM QPE2 16 JULY 2023 · No negative marking.

Question 1

+3 marksOne or more correct options

Select all that apply.

  1. A

    There exists at least one function for which MP neuron can not find a threshold such that it produces zero error.

  2. B

    One can manually find the threshold such that MP neuron produces zero classification error for all possible functions.

  3. C

    There exist at least 4 boolean functions such that MP neuron can represent them with zero classification error.

  4. D

    MP neuron must have at least one inhibitory input to implement all possible boolean functions.

Show answer

Correct answers

  • A

    There exists at least one function for which MP neuron can not find a threshold such that it produces zero error.

  • C

    There exist at least 4 boolean functions such that MP neuron can represent them with zero classification error.

Question 2

+3 marksOne correct option
  1. A

    True

  2. B

    False

  3. C

    Insufficient information

  4. D

    Not possible to decide

Show answer

Correct answer

  • A

    True

Question 3

+3 marksNumerical answer

Consider the data points (x1=[11],x2=[1−1],x3=[−11],x4=[−1−1])\left(x_1 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}, x_2 = \begin{bmatrix} 1 \\ -1 \end{bmatrix}, x_3 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}, x_4 = \begin{bmatrix} -1 \\ -1 \end{bmatrix}\right).

Of these, the points (x1,x2x_1, x_2 and x3x_3) belong to positive (1) class and the point x4x_4 belongs to negative (0) class. The perceptron uses the following decision rule

y^={1,if wTx≥00,wTx<0\hat{y} = \begin{cases} 1, & \text{if } w^T x \geq 0 \\ 0, & w^T x < 0 \end{cases}

Based on the above data, answer the given subquestions.

Suppose that the decision boundary passes through the origin and through the point D=[0.51]D = \begin{bmatrix} 0.5 \\ 1 \end{bmatrix}. The weight vector is initialized to w=[w0w1]w = \begin{bmatrix} w_0 \\ w_1 \end{bmatrix} with w0=−1w_0 = -1. What is the value of w1w_1?

Show answer

Correct answer: 0.5

Question 4

+2 marksNumerical answer

Consider the data points (x1=[11],x2=[1−1],x3=[−11],x4=[−1−1])\left(x_1 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}, x_2 = \begin{bmatrix} 1 \\ -1 \end{bmatrix}, x_3 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}, x_4 = \begin{bmatrix} -1 \\ -1 \end{bmatrix}\right).

Of these, the points (x1,x2x_1, x_2 and x3x_3) belong to positive (1) class and the point x4x_4 belongs to negative (0) class. The perceptron uses the following decision rule

y^={1,if wTx≥00,wTx<0\hat{y} = \begin{cases} 1, & \text{if } w^T x \geq 0 \\ 0, & w^T x < 0 \end{cases}

Based on the above data, answer the given subquestions.

How many points were correctly classified?

Show answer

Correct answer: 1

Question 5

+4 marksNumerical answer

Consider the data points (x1=[11],x2=[1−1],x3=[−11],x4=[−1−1])\left(x_1 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}, x_2 = \begin{bmatrix} 1 \\ -1 \end{bmatrix}, x_3 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}, x_4 = \begin{bmatrix} -1 \\ -1 \end{bmatrix}\right).

Of these, the points (x1,x2x_1, x_2 and x3x_3) belong to positive (1) class and the point x4x_4 belongs to negative (0) class. The perceptron uses the following decision rule

y^={1,if wTx≥00,wTx<0\hat{y} = \begin{cases} 1, & \text{if } w^T x \geq 0 \\ 0, & w^T x < 0 \end{cases}

Based on the above data, answer the given subquestions.

Update the weight values using the perceptron learning algorithm by visiting the following points in order (x4, x3). What is the angle (in degrees) between the updated weight vector and the initial weight vector?

Show answer

Correct answer: 63.25 (accepted within ±0.75)

Question 6

+3 marksOne correct option

Consider the data points (x1=[11],x2=[1−1],x3=[−11],x4=[−1−1])\left(x_1 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}, x_2 = \begin{bmatrix} 1 \\ -1 \end{bmatrix}, x_3 = \begin{bmatrix} -1 \\ 1 \end{bmatrix}, x_4 = \begin{bmatrix} -1 \\ -1 \end{bmatrix}\right).

Of these, the points (x1,x2x_1, x_2 and x3x_3) belong to positive (1) class and the point x4x_4 belongs to negative (0) class. The perceptron uses the following decision rule

y^={1,if wTx≥00,wTx<0\hat{y} = \begin{cases} 1, & \text{if } w^T x \geq 0 \\ 0, & w^T x < 0 \end{cases}

Based on the above data, answer the given subquestions.

  1. A

    True

  2. B

    False

  3. C

    Insufficient information to conclude

Show answer

Correct answer

  • A

    True

Question 7

+5 marksNumerical answer

Consider a sigmoid neuron that takes in an input vector x=[1−11−1]x = \begin{bmatrix} 1 \\ -1 \\ 1 \\ -1 \end{bmatrix}. The weight vector θ\theta is initialized to [−11−11]\begin{bmatrix} -1 \\ 1 \\ -1 \\ 1 \end{bmatrix}. The output from the sigmoid neuron is

y^=11+exp(−θTx)\hat{y} = \frac{1}{1 + exp(-\theta^T x)}

Suppose we use the following loss function

L=12(y−y^)2L = \frac{1}{2}(y - \hat{y})^2

Update the weight vector once by running the Gradient Descent algorithm with η=20\eta = 20. Assume the true label y=1y = 1. What is the new loss value (that is, the loss computed after updating the weight vector)?

Show answer

Correct answer: 0.43 (accepted within ±0.02)

Question 8

+4 marksOne correct option

Look at the contours of a hill shown below. Suppose a person walks from location A to location C via location B. Then choose the correct statements from the following list of statements

  1. A

    The person has to do one steep ascending and one steep descending

  2. B

    The person has to do two steep ascending and two steep descending

  3. C

    The person has to do one steep ascending and two steep descending

  4. D

    The person has to do two steep ascending and one steep descending

Show answer

Correct answer

  • A

    The person has to do one steep ascending and one steep descending

Question 9

+4 marksNumerical answer

Consider a neural network with three hidden layers and one output layer. The hidden layers contain 100 neurons each. Suppose we have a square image of size 30×30 containing either a cat (positive class) or a dog (negative class). The neural network is designed to recognize it by outputting a probability score for each class. The input image is flattened into an array of size 900. Assume that all neurons in the network have bias associated with them and use the sigmoid activation function. How many parameters are there in the network?

Show answer

Correct answer: 110502

Question 10

+5 marksNumerical answer

Based on the above data, answer the given subquestions.

Suppose that the neural network is used for a classification problem with 1000 classes (such that any given input belongs to exactly one class). Suppose further that the number of neurons in the second hidden layer is 3 and the number of neurons in the first hidden layer is also 3. The weights of W3W_3 are all initialized to 1. The input h0=[101]h_0 = \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}. The other weights W1W_1 and W2W_2 are initialized as follows,

W1=W2=[101011110]W_1 = W_2 = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 0 \end{bmatrix}

The true label y=500y = 500 is one hot encoded as y=[00⋯01000⋯0]Ty = \begin{bmatrix} 0 & 0 & \cdots & 0 & 1 & 0 & 0 & 0 & \cdots & 0 \end{bmatrix}^T. Assume that the output layer uses softmax activation and the neurons in the network has no bias associated with it. Compute the cross entropy loss.

Note:If you think the given information is not sufficient to calculate the loss, then enter -1 as answer.

Show answer

Correct answer: 6.95 (accepted within ±0.1)

Question 11

+5 marksNumerical answer

Based on the above data, answer the given subquestions.

Assume we have only three neurons in the output layer with a softmax activation function. Suppose that the weights are initialized as follows

W1=W2=W3=[101011110]. Moreover,W_1 = W_2 = W_3 = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 0 \end{bmatrix}. \text{ Moreover,}

a1=[211]a2=[3.222.923.22]a3=[3.843.823.82]y=[100]a_1 = \begin{bmatrix} 2 \\ 1 \\ 1 \end{bmatrix} \quad a_2 = \begin{bmatrix} 3.22 \\ 2.92 \\ 3.22 \end{bmatrix} \quad a_3 = \begin{bmatrix} 3.84 \\ 3.82 \\ 3.82 \end{bmatrix} \quad y = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}

Use cross entropy loss and compute the gradient of w10w_{10} (that is, ∇w10\nabla w_{10}) of W3W_3. (More precisely, ∇w310\nabla w_{310})

Show answer

Correct answer: 0.65 (accepted within ±0.05)

Question 12

+5 marksNumerical answer

Based on the above data, answer the given subquestions.

Assume we have only three neurons in the output layer with a softmax activation function. Suppose that the weights are initialized as follows

W1=W2=W3=[101011110]. Moreover,W_1 = W_2 = W_3 = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 0 \end{bmatrix}. \text{ Moreover,}

a1=[211]a2=[3.222.923.22]a3=[3.843.823.82]y=[100]a_1 = \begin{bmatrix} 2 \\ 1 \\ 1 \end{bmatrix} \quad a_2 = \begin{bmatrix} 3.22 \\ 2.92 \\ 3.22 \end{bmatrix} \quad a_3 = \begin{bmatrix} 3.84 \\ 3.82 \\ 3.82 \end{bmatrix} \quad y = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}

Use cross entropy loss and compute the gradient of w10w_{10} (that is, ∇w10\nabla w_{10}) of W2W_2. (More precisely, ∇w210\nabla w_{210})

Show answer

Correct answer: 0.115 (accepted within ±0.015)

Question 13

+2 marksNumerical answer

Suppose that a team solves a 1000-class classification problem using a neural network that contains 32 layers. Assume that the training set contains exactly 32 samples per class. The team creates batches of samples, each of size 32. The batch is created such that all the samples in a batch belongs to the same class.
Based on the above data, answer the given subquestions.

Suppose that the team trains the neural network with the given configuration using mini-batch Gradient Descent algorithm for 32 epochs. Then how many times do the parameters of the network get updated?

Show answer

Correct answer: 32000

Question 14

+2 marksNumerical answer

Suppose that a team solves a 1000-class classification problem using a neural network that contains 32 layers. Assume that the training set contains exactly 32 samples per class. The team creates batches of samples, each of size 32. The batch is created such that all the samples in a batch belongs to the same class.
Based on the above data, answer the given subquestions.

Suppose we use SGD (Stochastic Gradient Descent) algorithm to update the parameters of the network by running it for 32 epochs. Then how many times do the parameters of the network get updated?

Show answer

Correct answer: 1024000