H13-311_V3.5 · Question #255
When using TensorFlow2. 0 of keras When building a neural network with an interface, the network needs to be compiled. Which of the following methods should be used to work?
The correct answer is A. compile. In TensorFlow 2.0's Keras API, compile() is the method that configures a model for training by specifying the optimizer, loss function, and evaluation metrics - it must be called before training begins. Options B (write) and C (join) are not Keras model methods at all and have…
Question
When using TensorFlow2. 0 of keras When building a neural network with an interface, the network needs to be compiled. Which of the following methods should be used to work?
Options
- Acompile
- Bwrite
- Cjoin
- Dfit
How the community answered
(48 responses)- A75% (36)
- B13% (6)
- C4% (2)
- D8% (4)
Explanation
In TensorFlow 2.0's Keras API, compile() is the method that configures a model for training by specifying the optimizer, loss function, and evaluation metrics - it must be called before training begins. Options B (write) and C (join) are not Keras model methods at all and have no role in the neural network workflow. Option D (fit) is a real Keras method, but it comes after compilation - fit() is used to actually train the model on data, not to set it up.
Memory tip: Think of building the model as a three-step recipe - build → compile → fit. "Compile" mirrors the programming concept of preparing code before execution: you're telling Keras how to learn before it starts learning.
Topics
Community Discussion
No community discussion yet for this question.