Challenge - 5 Problems
Keras Model Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2: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?
Attempts:
2 left
💡 Hint
Think about how layers are added in a simple list.
✗ Incorrect
The Sequential model lets you add layers in order, so you don't have to manually connect each layer's inputs and outputs.
❓ Predict Output
intermediate2: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
Attempts:
2 left
💡 Hint
The output shape shows batch size as None and last layer units.
✗ Incorrect
The last Dense layer has 3 units, so output shape is (None, 3), where None is batch size.
❓ Model Choice
advanced2:30remaining
Choosing Keras Functional API for complex models
Why would you choose Keras Functional API over Sequential model?
Attempts:
2 left
💡 Hint
Think about models that are not just a simple chain of layers.
✗ Incorrect
Functional API allows building complex architectures like branching or merging layers, which Sequential cannot do.
❓ Hyperparameter
advanced2:30remaining
Effect of batch size in Keras model training
What is the main effect of increasing batch size during Keras model training?
Attempts:
2 left
💡 Hint
Think about how many samples are processed before updating weights.
✗ Incorrect
Larger batch sizes mean fewer updates per epoch, which can speed training but might hurt how well the model generalizes.
❓ Metrics
expert3: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?
Attempts:
2 left
💡 Hint
Think about what it means when training improves but validation does not.
✗ Incorrect
When training accuracy improves but validation accuracy does not, the model memorizes training data but fails on unseen data, a sign of overfitting.