0
0
TensorFlowml~20 mins

Why Keras simplifies model building in TensorFlow - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Keras Model Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why does Keras use a Sequential model?
Keras provides a Sequential model to build neural networks. What is the main reason this model simplifies building layers?
AIt only supports convolutional layers, limiting complexity.
BIt allows stacking layers one after another in a simple linear way without managing connections manually.
CIt requires writing low-level code for each neuron connection.
DIt automatically tunes hyperparameters without user input.
Attempts:
2 left
💡 Hint
Think about how layers are added in a simple list.
Predict Output
intermediate
2:00remaining
Output shape after adding layers in Keras Sequential
What will be the output shape of the model after running this code?
TensorFlow
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
model = Sequential()
model.add(Dense(10, input_shape=(5,)))
model.add(Dense(3))
output_shape = model.output_shape
A(3, 5)
B(5, 10)
C(None, 10)
D(None, 3)
Attempts:
2 left
💡 Hint
The output shape shows batch size as None and last layer units.
Model Choice
advanced
2:30remaining
Choosing Keras Functional API for complex models
Why would you choose Keras Functional API over Sequential model?
ATo build models with multiple inputs or outputs and non-linear layer connections.
BTo simplify stacking layers in a straight line.
CTo automatically generate training data.
DTo avoid writing any code for model training.
Attempts:
2 left
💡 Hint
Think about models that are not just a simple chain of layers.
Hyperparameter
advanced
2:30remaining
Effect of batch size in Keras model training
What is the main effect of increasing batch size during Keras model training?
AIt changes the activation function of layers.
BIt increases the model's number of layers automatically.
CIt reduces the number of weight updates per epoch, potentially speeding up training but may reduce generalization.
DIt disables dropout layers during training.
Attempts:
2 left
💡 Hint
Think about how many samples are processed before updating weights.
Metrics
expert
3:00remaining
Interpreting Keras model accuracy during training
During training, a Keras model shows training accuracy increasing but validation accuracy stays flat or decreases. What does this indicate?
AThe model is overfitting the training data and not generalizing well to new data.
BThe model is underfitting and needs more layers.
CThe optimizer is not updating weights correctly.
DThe batch size is too small causing unstable training.
Attempts:
2 left
💡 Hint
Think about what it means when training improves but validation does not.