0
0
TensorFlowml~10 mins

Batch size and epochs in TensorFlow - Interactive Code Practice

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

Complete the code to set the batch size when training a TensorFlow model.

TensorFlow
model.fit(x_train, y_train, epochs=5, batch_size=[1])
Drag options to blanks, or click blank then click option'
A5
B1
C32
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Using epochs value as batch size.
Setting batch size to 1 which can slow training.
Using a very large batch size that may not fit in memory.
2fill in blank
medium

Complete the code to set the number of epochs for training a TensorFlow model.

TensorFlow
model.fit(x_train, y_train, epochs=[1], batch_size=32)
Drag options to blanks, or click blank then click option'
A10
B0
C1000
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Setting epochs to zero or negative values.
Using an extremely large number causing long training times.
3fill in blank
hard

Fix the error in the code by choosing the correct batch size value.

TensorFlow
model.fit(x_train, y_train, epochs=5, batch_size=[1])
Drag options to blanks, or click blank then click option'
A0
B32
C-10
DNone
Attempts:
3 left
💡 Hint
Common Mistakes
Using zero or negative batch size.
Passing None instead of an integer.
4fill in blank
hard

Fill both blanks to correctly set epochs and batch size in model training.

TensorFlow
model.fit(x_train, y_train, epochs=[1], batch_size=[2])
Drag options to blanks, or click blank then click option'
A10
B32
C5
D64
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping epochs and batch size values.
Using batch size values that are too large.
5fill in blank
hard

Fill all three blanks to create a training call with epochs, batch size, and validation split.

TensorFlow
model.fit(x_train, y_train, epochs=[1], batch_size=[2], validation_split=[3])
Drag options to blanks, or click blank then click option'
A20
B64
C0.2
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using validation split as an integer instead of decimal.
Setting batch size or epochs to zero or negative.