Quiz Space

January 2024 term · Deep Learning · BSCS3004

Deep Learning Quiz 1: 25 February 2024 (January 2024 term)

The IIT Madras BS Deep Learning (Deep Learning) Quiz 1 paper sat on 25 Feb 2024, in the January 2024 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
Numerical
5
MCQ
4
Written
4

Updated

Official paper: IIT M DEGREE AN2 EXAM QDB2 25 Feb 2024 · No negative marking.

Question 1

+4 marksOne or more correct options

Consider a neuron with binary inputs x1 and x2, and an output y. The neuron computes the weighted sum of its inputs and produces an output according to a threshold. The threshold is denoted as θ. The activation function is such that y = 1 if the weighted sum is greater than or equal to θ, otherwise y = 0.
Which of the following statements are correct regarding the neuron’s ability to represent logical AND and OR functions?

Select all that apply.

  1. A

    The neuron can implement the AND function by setting appropriate weights and a threshold.

  2. B

    The neuron can implement the OR function by setting appropriate weights and a threshold.

  3. C

    There exists a single set of weights and a threshold that allows the same neuron to correctly implement both the AND and OR functions simultaneously.

  4. D

    Neurons are limited to implementing either the AND or the OR function and cannot represent both simultaneously.

Show answer

Correct answers

  • A

    The neuron can implement the AND function by setting appropriate weights and a threshold.

  • B

    The neuron can implement the OR function by setting appropriate weights and a threshold.

  • D

    Neurons are limited to implementing either the AND or the OR function and cannot represent both simultaneously.

Question 2

+3 marksNumerical answer

Suppose we have a perceptron with two inputs, x1 and x2. This perceptron undergoes training on a small dataset containing three points: (−1, 2) labeled as class 0, (0,−1) labeled as class 1, and (2, 1) labeled as class 0. The weights of the perceptron are initialized to zeros, and the model is trained until it reaches convergence. Given this scenario, what would be the assigned output class by the trained perceptron for the new point (−2, 0)?

Show answer

Correct answer: 1

Question 3

+3 marksNumerical answer

You are training a neural network for sentiment analysis on a dataset of 10,000 text reviews. The dataset is divided into 80% for training and 20% for testing. You decide to use Minibatch Gradient Descent with a batch size of 32. If you perform a total of 100 epochs, how many parameter updates will be performed in total?

Show answer

Correct answer: 25000

Question 4

+2 marksOne correct option

Let’s assume a continuous function f(x1,x2) is approximated using 3D tower function with a 3 hidden layer neural network using 100 towers. How many minimum number of neurons will we need to approximate the function f(x1,x2) ?

  1. A

    201

  2. B

    300

  3. C

    801

  4. D

    701

  5. E

    800

Show answer

Correct answer

  • C

    801

Question 5

+4 marksNumerical answer

The logistic sigmoid neuron σ(x)\sigma(x) is defined as follows

σ(x)=11+exp(−(wx+b))\sigma(x) = \frac{1}{1 + exp(-(wx + b))}

where w,b∈Rw, b \in \mathbb{R} are learnable parameters.Take Mean Square Error loss where required

L=0.5∗(y^−y)2L = 0.5 * (\hat{y} - y)^2

Suppose we use the sigmoid function to fit the pair x=0,y=1x = 0, y = 1, where xx is an input and yy is the ground truth. Suppose that ww is initialized to w=2w = 2 and bb is initialized to b=1b = 1.The prediction y^\hat{y} by the model for the current w,bw, b is, y^=0.731\hat{y} = 0.731. Update the parameter once by keeping η=10\eta = 10 and compute the loss. Enter the new loss value.

Note: Enter the loss value to three significant digits. That is, if your answer is 0.06134, then enter it as 0.061

Show answer

Correct answer: 0.016 (accepted within ±0.004)

Question 6

+4 marksNumerical answer
Show answer

Correct answer: 0.8 (accepted within ±0.1)

Question 7

+4 marksOne correct option
  1. A

    Increasing the value of b shifts the sigmoid function to the left (i.e., towards negative infinity)

  2. B

    Increasing the value of b shifts the sigmoid function to the right (i.e., towards positive infinity)

  3. C

    Decreasing the value of w increases the steepness of the sigmoid function

  4. D

    Increasing the value of w decreases the steepness of the sigmoid function

Show answer

Correct answer

  • A

    Increasing the value of b shifts the sigmoid function to the left (i.e., towards negative infinity)

Question 8

+4 marksOne correct option

Which of the following is true, given the optimal learning rate?

  1. A

    Batch gradient descent is always guaranteed to converge to the global optimum of a loss function.

  2. B

    Stochastic gradient descent is always guaranteed to converge to the global optimum of a loss function.

  3. C

    For convex loss functions, stochastic gradient descent is guaranteed to eventually converge to the global optimum while batch gradient descent is not.

  4. D

    For convex loss functions, both stochastic gradient descent and batch gradient descent will eventually converge to the global optimum.

  5. E

    For convex loss functions, neither stochastic gradient descent nor batch gradient descent are guaranteed to converge to the global optimum.

  6. F

    For convex loss functions, batch gradient descent is guaranteed to eventually converge to the global optimum while stochastic gradient descent is not.

Show answer

Correct answer

  • F

    For convex loss functions, batch gradient descent is guaranteed to eventually converge to the global optimum while stochastic gradient descent is not.

Question 9

+3 marksNumerical answer

Based on the above data, answer the given subquestions.

How many parameters (including biases) are there in the entire network?

Show answer

Correct answer: 4285

Question 10

+4 marksWritten answer

Based on the above data, answer the given subquestions.

Suppose that all elements in the input vector are zero and the corresponding true label is also 0. Further, suppose that all the parameters are initialized to zero.
What is the loss value if cross-entropy loss is used? Use natural logarithm ln.

Show answer

Correct answer: 1.4 to 1.8

Question 11

+4 marksWritten answer

Based on the above data, answer the given subquestions.

Assuming that all weights between layers h3 and O are initialized to one, with no bias associated with any neuron, what would be the computed cross-entropy loss for a given single data point? If the provided information is insufficient, please enter −1.

Show answer

Correct answer: 1.4 to 1.8

Question 12

+4 marksWritten answer

Consider a neural network with two hidden layers and one output layer, as shown below. Here, aka_k is a pre-activation and hkh_k is the output from the k−k-th layer. All the neurons in the hidden layers use a sigmoid activation function. Suppose that the neural network is used for a classification problem with 3 classes (such that any given input belongs to exactly one class). Suppose further that the number of neurons in each hidden layer is 3 and we have only three neurons in the output layer. Suppose that the weights are initialized as follows

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

The true label for the input h0=[001]h_0 = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} is one hot encoded as y=[100]y = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}.

Assume that the output layer uses softmax activation and the neurons in the network has no bias associated with it.

Based on the above data, answer the given subquestions.

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: 0.3 to 0.4

Question 13

+4 marksWritten answer

Consider a neural network with two hidden layers and one output layer, as shown below. Here, aka_k is a pre-activation and hkh_k is the output from the k−k-th layer. All the neurons in the hidden layers use a sigmoid activation function. Suppose that the neural network is used for a classification problem with 3 classes (such that any given input belongs to exactly one class). Suppose further that the number of neurons in each hidden layer is 3 and we have only three neurons in the output layer. Suppose that the weights are initialized as follows

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

The true label for the input h0=[001]h_0 = \begin{bmatrix} 0 \\ 0 \\ 1 \end{bmatrix} is one hot encoded as y=[100]y = \begin{bmatrix} 1 \\ 0 \\ 0 \end{bmatrix}.

Assume that the output layer uses softmax activation and the neurons in the network has no bias associated with it.

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.1 to 0.2

Question 14

+3 marksOne correct option

Consider the following image:

As per your understanding of optimization algorithms, which of the following mappings will be correct (assume optimal learning rate)?

  1. A

    1: Gradient Descent
    2: Momentum based Gradient Descent
    3: Nesterov Accelerated Gradient Descent

  2. B

    1: Momentum based Gradient Descent
    2: Gradient Descent
    3: Nesterov Accelerated Gradient Descent

  3. C

    1: Gradient Descent
    2: Nesterov Accelerated Gradient Descent
    3: Momentum based Gradient Descent

  4. D

    1: Momentum based Gradient Descent
    2: Nesterov Accelerated Gradient Descent
    3: Gradient Descent

Show answer

Correct answer

  • D

    1: Momentum based Gradient Descent
    2: Nesterov Accelerated Gradient Descent
    3: Gradient Descent