MS Artificial Intelligence

Deep Learning — Lecture 2, Set 01

Take the Deep Learning — Lecture 2, Set 01: 20 multiple-choice questions (30 minutes) with instant scoring and a full answer review. Covers 20 Deep…

What this test covers

Sample questions with answers

The first 5 questions of this test, with the correct answer and explanation.

  1. Q1. What exactly is MNIST?

    • A. 70,000 small grey-scale pictures of the digits 0 to 9, each 28 x 28 pixels, each with a label ✓
    • B. 1.4 million colour photographs in 1,000 categories
    • C. 60,000 handwritten letters of the English alphabet
    • D. A library for building neural networks in Python

    Answer: A. 70,000 small grey-scale pictures of the digits 0 to 9, each 28 x 28 pixels, each with a label

    Explanation: MNIST is 70,000 grey-scale 28 x 28 pictures of the digits 0 to 9, each with a label saying which digit it is.

  2. Q2. How is MNIST split between learning and testing?

    • A. 50,000 for learning and 20,000 for testing
    • B. 60,000 for learning and 10,000 kept aside to test ✓
    • C. 35,000 for learning and 35,000 for testing
    • D. 70,000 for learning, with testing done on the same images

    Answer: B. 60,000 for learning and 10,000 kept aside to test

    Explanation: 60,000 images are used for learning and 10,000 are kept aside to test.

  3. Q3. How many numbers go into the network for one image, and how many come out?

    • A. 28 in and 10 out
    • B. 512 in and 10 out
    • C. 784 in and 512 out
    • D. 784 pixel values in and 10 numbers out ✓

    Answer: D. 784 pixel values in and 10 numbers out

    Explanation: The network takes the 784 pixel values in and gives out 10 numbers: how likely the picture is each digit from 0 to 9.

  4. Q4. According to the road map, what does learning (training) mean?

    • A. Show an example, compare the answer with the true label, measure the error with one number, nudge each weight to shrink it, repeat ✓
    • B. Store every training image so the network can look the answer up later
    • C. Write explicit rules for each handwriting style and test them
    • D. Increase the number of layers until the accuracy stops improving

    Answer: A. Show an example, compare the answer with the true label, measure the error with one number, nudge each weight to shrink it, repeat

    Explanation: Training means: show an example, compare with the true label, measure the error with the loss, work out which direction to nudge each weight, nudge a little, and repeat tens of thousands of times.

  5. Q5. What two layers make up the MNIST network in the Keras code?

    • A. Dense(784, 'relu') and Dense(10, 'sigmoid')
    • B. Dense(512, 'softmax') and Dense(10, 'relu')
    • C. Dense(512, 'relu') and Dense(10, 'softmax') ✓
    • D. Conv2D(512) and Dense(10, 'softmax')

    Answer: C. Dense(512, 'relu') and Dense(10, 'softmax')

    Explanation: The network adds Dense(512, activation='relu') then Dense(10, activation='softmax').

The other 15 questions

Take the timed test (free, no sign-up) to see your score and the answer and explanation for every question.

  1. Q6. What do the 512 units in the first Dense layer each produce?

    • A. One number from all 784 pixels
    • B. One probability for each of the 10 digits
    • C. A 28 x 28 feature map
    • D. A copy of one of the input pixels
  2. Q7. In compile(optimizer='rmsprop', loss='categorical_crossentropy', metrics=['accuracy']), what do the three arguments choose?

    • A. The dataset, the batch size and the number of epochs
    • B. The number of layers, the number of units and the activation
    • C. How to adjust the weights, how to measure the error, and what to report to us
    • D. The hardware, the precision and the random seed
  3. Q8. Why are the pixel values reshaped and divided by 255?

    • A. To reduce the file size of the dataset
    • B. To flatten each image into one row of 784 numbers and rescale them to 0-1, so small values of similar size keep the arithmetic stable
    • C. To convert the images from colour to grey-scale
    • D. To remove images that are too dark or too bright
  4. Q9. What does to_categorical do to the label 3, and why?

    • A. It converts it to the string "three" for readability
    • B. It scales it to 0.3 so it matches the pixel range
    • C. It leaves it as 3 but changes its data type to float32
    • D. It rewrites it as [0,0,0,1,0,0,0,0,0,0], the same shape as the 10 output probabilities
  5. Q10. In fit(train_images, train_labels, epochs=5, batch_size=128), what is an epoch?

    • A. One pass over all 60,000 training images
    • B. One batch of 128 images
    • C. One weight update
    • D. One forward pass through a single image
  6. Q11. What test accuracy does the MNIST example reach, and on what data?

    • A. 0.9273 on the training images
    • B. 0.9692 on a validation split
    • C. 0.9785 on 10,000 images the network has never seen
    • D. 1.0000 on the images it was trained on
  7. Q12. A scalar such as np.array(12) is which kind of tensor, and what is its ndim?

    • A. A 1D tensor with ndim 1
    • B. A 0D tensor with ndim 0
    • C. A 2D tensor with ndim 2
    • D. Not a tensor at all
  8. Q13. np.array([12, 3, 6, 14]) is:

    • A. A scalar (0D tensor)
    • B. A matrix (2D tensor)
    • C. A 3D tensor
    • D. A vector (1D tensor)
  9. Q14. What are tensors, in the lecture's definition?

    • A. Multidimensional NumPy arrays, containers for numbers
    • B. Functions that transform one layer into the next
    • C. The adjustable weights of a neural network
    • D. A type of activation function
  10. Q15. What are the three tensor attributes described in the lecture?

    • A. Size, speed and precision
    • B. Number of axes (rank), shape, and data type (dtype)
    • C. Width, height and depth
    • D. Weights, biases and activations
  11. Q16. For MNIST, what do train_images.ndim, train_images.shape and train_images.dtype return?

    • A. 2, (60000, 784) and float32
    • B. 3, (60000, 28, 28) and float64
    • C. 3, (60000, 28, 28) and uint8
    • D. 4, (60000, 28, 28, 1) and uint8
  12. Q17. Which tensor shape is correct for time-series or sequence data?

    • A. 2D tensors of shape (samples, features)
    • B. 3D tensors of shape (samples, time-steps, features)
    • C. 4D tensors of shape (samples, height, width, channels)
    • D. 5D tensors of shape (samples, frames, height, width, channels)
  13. Q18. What is the shape of a batch of 128 colour images of size 256 x 256, in channels-last convention?

    • A. (128, 3, 256, 256)
    • B. (128, 256, 256, 1)
    • C. (256, 256, 3, 128)
    • D. (128, 256, 256, 3)
  14. Q19. Which framework pairing matches the two image-tensor conventions correctly?

    • A. Channels-last is the TensorFlow and Keras default; channels-first is used by Theano and PyTorch
    • B. Channels-first is the TensorFlow and Keras default; channels-last is used by Theano and PyTorch
    • C. Both TensorFlow and PyTorch use channels-last
    • D. The convention is chosen per image, not per framework
  15. Q20. What does train_images[:, 14:, 14:] select?

    • A. Images 14 to the end, in full
    • B. The first 14 rows and columns of every image
    • C. The 14 x 14 pixels in the bottom-right corner of all images
    • D. Every 14th image in the dataset