TensorFlow & Keras test (Intermediate)
30 questions · 35 minutes · Free
Building, training and deploying models with TensorFlow and Keras.
Take the TensorFlow & Keras test
What it covers
- Sequential and functional APIs
- Callbacks and training
- tf.data pipelines
- Transfer learning
- TF Serving and TFLite
Interview format
- Questions: 30 questions — 18 multiple choice, 9 multi-answer, 3 predict-the-output
- Time: 35 minutes, timed from the first question
- Difficulty: Intermediate
- Skill area: AI & ML
- Price: Free
Sample questions
5 sample questions from the TensorFlow & Keras test, with the answers. Samples are taken out of the live test, so you will not meet these when you sit it.
Which of the following statements accurately describes the model summary output in Keras?
- The model summary output is generated during the model training phase.
- The model summary output includes the number of parameters in each layer.
- The model summary output is used for visualizing training loss curves.
- The model summary output contains the training and validation accuracy metrics.
Answer: B. The model summary output includes the number of parameters in each layer.
The model summary output in Keras provides a detailed overview of the model architecture, including the layer names, output shapes, and the number of parameters in each layer. This helps in understanding the model's structure and complexity. The other options are incorrect because they describe features not directly related to the model summary output.
What is the primary behavior of a TFLite model when deployed on mobile or embedded devices?
- The TFLite model is primarily used for training large-scale machine learning models.
- The TFLite model cannot be used for inference on edge devices.
- The TFLite model will run on mobile and embedded devices with optimized performance.
- The TFLite model is only compatible with desktop applications.
Answer: C. The TFLite model will run on mobile and embedded devices with optimized performance.
TFLite models are specifically designed for deployment on mobile and embedded devices, with optimizations for size and speed. The other options are either incorrect or unrelated to the primary purpose of TFLite.
Which of the following correctly describes how a custom loss function is defined in TensorFlow?
- A custom loss function is defined as a Python function that takes y_true and y_pred as inputs and returns a scalar loss value.
- A custom loss function is only available in the functional API and not in the Sequential API.
- A custom loss function can only be used during training and not during evaluation.
- A custom loss function must be written in C++ and compiled as a TensorFlow op.
Answer: A. A custom loss function is defined as a Python function that takes y_true and y_pred as inputs and returns a scalar loss value.
A custom loss function in TensorFlow is typically implemented as a Python function that accepts the true labels (y_true) and predicted values (y_pred) and computes a scalar loss value. This is the correct definition. The other options may describe incorrect or incomplete implementations, such as not returning a scalar or not using the correct parameters.
What does the model summary in Keras primarily display?
- The model's input and output data
- The model's architecture and layer configurations
- The model's actual weights and biases
- The model's training progress and loss values
Answer: B. The model's architecture and layer configurations
The model summary in Keras provides a textual description of the model's architecture, including the layers, their output shapes, and the number of parameters. It does not show the actual weights, training progress, or loss values.
What happens when you use a pre-trained model for transfer learning and train it on a new dataset?
- The model will only use the pre-trained weights for the first layer and train the rest from scratch.
- The model will completely ignore the pre-trained weights and train from scratch.
- The model will use the pre-trained weights as a starting point and fine-tune them on the new dataset.
- The pre-trained weights will be replaced entirely with new weights during training.
Answer: C. The model will use the pre-trained weights as a starting point and fine-tune them on the new dataset.
When using transfer learning with pre-trained models, the model leverages the pre-trained weights as a starting point and adapts them to the new dataset through fine-tuning. This allows the model to benefit from the pre-trained features while adjusting to the specific patterns in the new data.
Frequently asked questions
- How many questions are in the TensorFlow & Keras test?
- 30 questions (18 multiple choice, 9 multi-answer, 3 predict-the-output), with 35 minutes to answer them.
- What does the TensorFlow & Keras test cover?
- Sequential and functional APIs, Callbacks and training, tf.data pipelines, Transfer learning, TF Serving and TFLite.
- Is the TensorFlow & Keras test free?
- Yes. It is free to take with a readyforhires account.
- What level is the TensorFlow & Keras test?
- Intermediate, in AI & ML.