0
0
Computer Visionml~10 mins

Architecture search concepts in Computer Vision - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a simple convolutional layer in a neural network.

Computer Vision
conv_layer = Conv2D(filters=32, kernel_size=3, activation=[1])
Drag options to blanks, or click blank then click option'
A'softmax'
B'sigmoid'
C'relu'
D'linear'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'softmax' in a convolutional layer activation instead of ReLU.
Forgetting to add an activation function.
2fill in blank
medium

Complete the code to add a pooling layer after a convolutional layer.

Computer Vision
pool_layer = MaxPooling2D(pool_size=[1])
Drag options to blanks, or click blank then click option'
A(3, 3)
B(2, 2)
C(1, 1)
D(4, 4)
Attempts:
3 left
💡 Hint
Common Mistakes
Using a pool size of (1, 1) which does not reduce dimensions.
Choosing too large pool sizes that overly reduce feature maps.
3fill in blank
hard

Fix the error in the code to correctly compile a model with categorical crossentropy loss.

Computer Vision
model.compile(optimizer='adam', loss=[1], metrics=['accuracy'])
Drag options to blanks, or click blank then click option'
A'categorical_crossentropy'
B'hinge'
C'binary_crossentropy'
D'mean_squared_error'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'binary_crossentropy' for multi-class problems.
Using regression loss functions like 'mean_squared_error' incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps layer names to their output shapes if the output has more than 2 dimensions.

Computer Vision
layer_shapes = {layer.name: layer.output_shape for layer in model.layers if [1] > [2]
Drag options to blanks, or click blank then click option'
Alen(layer.output_shape)
B2
Clayer.name
Dlayer.output_shape
Attempts:
3 left
💡 Hint
Common Mistakes
Comparing layer.name to a number.
Using layer.output_shape directly in comparison without len().
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps layer names to the number of parameters if the layer has more than 1000 parameters.

Computer Vision
param_counts = {layer.[1]: layer.[2] for layer in model.layers if layer.[3] > 1000}
Drag options to blanks, or click blank then click option'
Aname
Bcount_params()
Doutput_shape
Attempts:
3 left
💡 Hint
Common Mistakes
Using layer.output_shape instead of count_params().
Not calling count_params() as a method.