0
0
ML Pythonml~20 mins

Neural network architecture in ML Python - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Neural Network Architect Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Model Choice
intermediate
2:00remaining
Choosing the right layer for image feature extraction

You want to build a neural network to recognize objects in photos. Which layer type is best to start with for extracting features like edges and shapes?

AA dropout layer
BA convolutional layer
CA fully connected layer
DA recurrent layer
Attempts:
2 left
💡 Hint

Think about which layer type is designed to scan images for patterns.

Metrics
intermediate
1:30remaining
Understanding output shape of a dense layer

You have a dense (fully connected) layer with 128 neurons. If the input to this layer has shape (batch_size, 64), what will be the output shape?

A(batch_size, 64)
B(64, 128)
C(128, 64)
D(batch_size, 128)
Attempts:
2 left
💡 Hint

Each neuron produces one output per input example.

Predict Output
advanced
2:30remaining
Output shape after convolution and pooling

What is the output shape of the tensor after applying the following layers in order?

Input shape: (32, 64, 64, 3)  # batch_size=32, 64x64 RGB images
Conv2D(filters=16, kernel_size=3, padding='same')
MaxPooling2D(pool_size=2)
A(32, 32, 32, 16)
B(32, 62, 62, 16)
C(32, 64, 64, 16)
D(32, 31, 31, 16)
Attempts:
2 left
💡 Hint

Remember 'same' padding keeps width and height, pooling halves them.

🔧 Debug
advanced
2:00remaining
Identifying error in model layer connection

Consider this simple neural network code snippet:

model = Sequential()
model.add(Dense(64, input_shape=(100,)))
model.add(Conv2D(32, kernel_size=3))
model.add(Flatten())
model.add(Dense(10, activation='softmax'))

What error will this code raise when run?

ANo error, model compiles successfully
BTypeError because Dense layer cannot be followed by Conv2D
CValueError due to Conv2D expecting 4D input but receiving 2D
DRuntimeError due to missing activation function in Conv2D
Attempts:
2 left
💡 Hint

Check the input shape expected by Conv2D layers.

🧠 Conceptual
expert
2:30remaining
Effect of increasing depth on model capacity

What is the main effect of increasing the number of layers (depth) in a neural network architecture?

AIt increases the model's ability to learn complex features by creating hierarchical representations
BIt decreases training time by reducing parameters
CIt always reduces overfitting by simplifying the model
DIt makes the model less flexible and harder to train
Attempts:
2 left
💡 Hint

Think about how deeper networks learn features step-by-step.