Which two arguments must be provided to model.compile() before training a Keras model?
-
A
A learning rate and a batch size
-
B
A dataset and the number of epochs
-
C
An input shape and an output layer
-
D
An optimizer and a loss function
Correct answer
Correct answer
D. An optimizer and a loss function
19 views
Explanation
compile() sets how weights are updated (optimizer) and what is minimised (loss). Metrics are optional, and epochs and batch size go in fit().
Reference
Asked in: Data Science Interviews, AI Engineer Interviews
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ