0
0
TensorFlowml~5 mins

Multi-input and multi-output models in TensorFlow - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a multi-input model in machine learning?
A multi-input model is a model that takes more than one input data source at the same time to make predictions. For example, it can use both images and text together.
Click to reveal answer
beginner
What does a multi-output model do?
A multi-output model produces more than one prediction or output from the same input data. For example, it can predict both the price and the category of a house from its features.
Click to reveal answer
intermediate
How do you define multiple inputs in TensorFlow's Keras API?
You create separate Input layers for each input and then combine them in the model. For example, input1 = tf.keras.Input(shape=(10,)) and input2 = tf.keras.Input(shape=(5,)).
Click to reveal answer
intermediate
How can you compile a multi-output model with different losses for each output?
You pass a dictionary to the loss parameter with keys as output names and values as loss functions. For example, loss={'output1': 'mse', 'output2': 'binary_crossentropy'}.
Click to reveal answer
beginner
Why use multi-input and multi-output models in real life?
They help solve complex problems where data comes from different sources and multiple predictions are needed. For example, a health app might use sensor data and user info to predict heart rate and stress level.
Click to reveal answer
What is the main purpose of a multi-input model?
ATo take multiple data sources as input
BTo produce multiple outputs
CTo train faster
DTo reduce model size
How do you specify multiple outputs in a Keras model?
ABy creating multiple Input layers
BBy returning a list or dictionary of outputs from the model
CBy using only one output layer
DBy stacking layers vertically
Which argument allows you to assign different loss functions to each output in Keras?
Ametrics
Boptimizer
Closs
Dloss_weights
In a multi-input model, how are inputs combined before prediction?
AThey are used one after another
BThey are ignored except one
CThey are added as separate models
DThey are concatenated or merged inside the model
What is a real-life example of a multi-output model?
APredicting house price and house type from features
BClassifying images into cats or dogs
CTranslating text from English to French
DDetecting spam emails
Explain how you would build a simple multi-input model in TensorFlow Keras.
Think about how to handle each input separately and then join them.
You got /4 concepts.
    Describe how to train a multi-output model with different loss functions for each output.
    Focus on how losses are assigned and how training data is structured.
    You got /4 concepts.