0% found this document useful (0 votes)
9 views7 pages

CNN and RNN Concepts Quiz

The document consists of a series of multiple-choice questions related to Convolutional Neural Networks (CNNs), Keras, and various neural network architectures. It covers topics such as layer functions, model compilation, activation functions, and differences between frameworks like TensorFlow and PyTorch. The questions also explore specific architectures like LeNet, AlexNet, and LSTM, as well as their components and functionalities.

Uploaded by

nehasai1202
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views7 pages

CNN and RNN Concepts Quiz

The document consists of a series of multiple-choice questions related to Convolutional Neural Networks (CNNs), Keras, and various neural network architectures. It covers topics such as layer functions, model compilation, activation functions, and differences between frameworks like TensorFlow and PyTorch. The questions also explore specific architectures like LeNet, AlexNet, and LSTM, as well as their components and functionalities.

Uploaded by

nehasai1202
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1) Which layer in a CNN is responsible for detecting features such as edges or textures

in an image?
a) Fully connected layer
b) Convolutional layer
c) Pooling layer
d) Dropout layer

2) In CNNs, which of the following layers reduces the spatial dimensions of the image?
a) Convolutional layer
b) Pooling layer
c) Activation layer
d) Fully connected layer

3) In the following line of code, what does fashion_mnist.load_data() do?

(x_train, y_train), (x_test, y_test) = fashion_mnist.load_data()

a) It trains the model on the Fashion MNIST dataset


b) It downloads and loads the Fashion MNIST dataset into training and test sets
c) It preprocesses the dataset to normalize pixel values
d) It splits the dataset into training and testing subsets

4) What is the purpose of the input_shape=(28, 28, 1) argument in the first


convolutional layer?

[Link](layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)))

a) It defines the shape of the output from the convolutional layer


b) It specifies the input image size (28x28) and number of channels (1 for grayscale
images)
c) It sets the number of filters to 28
d) It defines the activation function to be used in the layer

5) Which Keras function is used to compile the model in the code?

a) [Link]()
b) [Link]()
c) [Link]()
d) [Link]()

6) Which operation is performed by the convolution layer in CNN?

a) Scaling the input image


b) Performing matrix multiplication
c) Sliding a filter over the input image to compute the feature map
d) Reducing the dimensionality of the feature map

7) Which type of pooling is commonly used in CNNs?

A )Average pooling
b) Max pooling
c) Min pooling
d) Random pooling

8) In LeNet architecture, which layer is responsible for performing down-sampling or


reducing the spatial dimensions of the image?

a) Convolutional layer
b) Pooling layer
c) Fully connected layer
d) Activation layer

9) LeNet-5 was originally used for the classification of which dataset?

a) CIFAR-10
b) MNIST
c) ImageNet
d) Fashion-MNIST

10) How many convolutional layers are there in the LeNet-5 architecture?

a) 1
b) 2
c) 3
d) 4
11) Which of the following code snippets is used to define a convolutional layer in Keras?

a) [Link](Conv2D(filters=32, kernel_size=(3, 3)))


b) [Link](Dense(units=32, kernel_size=(3, 3)))
c) [Link](LSTM(units=32))
d) [Link](Dropout(rate=0.5))

12) Which activation function was used in the AlexNet architecture?

a) Sigmoid
b) ReLU (Rectified Linear Unit)
c) Tanh
d) Softmax

13) How do ResNet models differ from AlexNet in terms of architecture depth?

a) ResNet has fewer layers and parameters than AlexNet


b) ResNet is much deeper than AlexNet, typically with hundreds of layers
c) Both ResNet and AlexNet have the same number of layers
d) AlexNet is deeper than ResNet

14) Which of the following architectures is designed to handle deeper networks without
facing degradation problems during training?

a) LeNet
b) AlexNet
c) ResNet
d) VGGNet

15) In the VGG architecture, what type of convolutional layers are used?

a) 1x1 convolutions
b) 3x3 convolutions
c) 5x5 convolutions
d) 7x7 convolutions

16) Which of the following TensorFlow methods is used to create a neural network layer in
Keras?

a) [Link]()
b) [Link]()
c) [Link]()
d) [Link].create_dense()

17) Consider the following code snippet. What does the model in the snippet do?

from [Link] import Sequential

from [Link] import Dense

model = Sequential()

[Link](Dense(128, activation='relu', input_dim=784))

[Link](Dense(10, activation='softmax'))

[Link](loss='categorical_crossentropy', optimizer='adam', metrics=['accuracy'])

a) The model is used for image classification with 784 input features and 10 output
classes
b) The model is used for text classification with a softmax output layer
c) The model is used for time-series prediction
d) The model is used for regression tasks with a continuous output

18) Which of the following is the primary difference between PyTorch and TensorFlow?

a) PyTorch is more suited for production, while TensorFlow is better for research
b) PyTorch uses dynamic computation graphs, whereas TensorFlow uses static
computation graphs
c) PyTorch supports GPUs, but TensorFlow does not
d) PyTorch does not have support for neural networks

19) Which of the following is a key characteristic of Recurrent Neural Networks (RNNs)?

a) They have no memory of previous inputs


b) They process each input independently and do not use context
c) They use feedback loops to maintain hidden states across time steps
d) They can only process fixed-size inputs
20) Given the following code snippet, what is being defined here?

model = Sequential()
[Link](LSTM(50, activation='tanh', input_shape=(100, 1)))

a) A feedforward neural network with one hidden layer


b) A simple LSTM model with 50 hidden units and an input shape of (100, 1)
c) A GRU model
d) A convolutional neural network (CNN)
21) In LSTM, which component controls how much of the previous memory is carried forward
to the next time step?

a) Forget gate
b) Input gate
c) Output gate
d) Memory cell
22) what does the input_shape=(100, 1) parameter in the LSTM layer define?

model = Sequential()

[Link](LSTM(50, activation='tanh', input_shape=(100, 1)))


[Link](Dense(10, activation='softmax'))

[Link](optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

a) 100 is the number of features, and 1 is the number of time steps


b) 100 is the number of time steps, and 1 is the number of features
c) 100 is the batch size
d) The shape of the output tensor

23) Which two gates are used in a GRU to control the flow of information?

a) Forget gate and input gate


b) Reset gate and update gate
c) Output gate and forget gate
d) Input gate and output gate
24) Which of the following is an advantage of RNNs over traditional feedforward neural
networks?

a) They are less computationally expensive


b) They can process sequential data by maintaining hidden states
c) They require less data to train
d) They are designed to handle non-sequential data better

25) Which of the following is true about LSTMs?

a) They are designed to capture long-range dependencies in sequential data


b) They can only process short-term dependencies effectively
c) LSTMs are not suitable for natural language processing tasks
d) They do not have an internal memory structure

26) What type of layer is being defined in the following code?

model = Sequential()

[Link](LSTM(64, activation='tanh', input_shape=(50, 1)))


[Link](Dense(10, activation='softmax'))

[Link](optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

a) A feedforward layer
b) A convolutional layer
c) An LSTM layer
d) A dropout layer

27) Which activation function is typically used in the gates of LSTM and GRU cells?

a) ReLU
b) Tanh
c) Sigmoid
d) Softmax

28) what does the [Link]() function do?

a) It compiles the model.


b) It evaluates the model's performance.
c) It trains the model on the dataset.
d) It saves the model to a file.
29) What is the default optimizer used in [Link]() if no optimizer is specified in TensorFlow?

a) Adam
b) SGD (Stochastic Gradient Descent)
c) Adagrad
d) RMSProp

30) Which layer in TensorFlow is typically used for image data and performs convolution operations?

a) [Link]
b) [Link].Conv2D
c) [Link]
d) [Link]

You might also like