0
0
TensorFlowml~10 mins

Why TensorFlow is the industry deep learning framework - Test Your Understanding

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

Complete the code to import TensorFlow correctly.

TensorFlow
import [1] as tf
Drag options to blanks, or click blank then click option'
Atorch
Bkeras
Ctensorflow
Dnumpy
Attempts:
3 left
💡 Hint
Common Mistakes
Importing 'torch' instead of 'tensorflow'.
Using 'keras' directly without TensorFlow.
2fill in blank
medium

Complete the code to create a simple sequential model in TensorFlow.

TensorFlow
model = tf.keras.models.Sequential([tf.keras.layers.Dense([1], activation='relu')])
Drag options to blanks, or click blank then click option'
A10
B'relu'
CSequential
Dcompile
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the activation function name as the first argument.
Using 'compile' instead of number of units.
3fill in blank
hard

Fix the error in compiling the model by filling the correct optimizer name.

TensorFlow
model.compile(optimizer='[1]', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
Drag options to blanks, or click blank then click option'
Atensorflow
Badam
Crelu
Dsoftmax
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'relu' or 'softmax' as optimizer.
Using 'tensorflow' as optimizer.
4fill in blank
hard

Fill both blanks to train the model with data and epochs.

TensorFlow
history = model.fit([1], [2], epochs=5)
Drag options to blanks, or click blank then click option'
Ax_train
By_train
Cx_test
Dy_test
Attempts:
3 left
💡 Hint
Common Mistakes
Using test data instead of training data for fitting.
Swapping inputs and labels.
5fill in blank
hard

Fill all three blanks to evaluate the model and print accuracy.

TensorFlow
loss, [1] = model.evaluate([2], [3])
print(f'Accuracy: {accuracy:.2f}')
Drag options to blanks, or click blank then click option'
Aloss
Baccuracy
Cy_test
Dx_test
Attempts:
3 left
💡 Hint
Common Mistakes
Assigning loss twice.
Swapping test inputs and labels.
Printing variable not assigned.