TensorFlowLesson 21Free preview
TFJS Models
This lesson is part of A.I. · All levels
Summary
In TensorFlow.js, the model is usually made with tf.sequential() in the form of a layer stack, e.g. tf.layers.dense. Once the network structure is compiled, the model is compiled with the optimizer and loss function, and then trained with model.fit(). After the training is completed, model.predict() is used to predict new data.
Key points
- Tf.sequential() make the model of stacks of layers one by one.
- It adds a layer of dense neurons.
- Model.compile() determines the optimizer and the loss function.
- Model.fit() runs training with a certain data and epoch number.
- Model.predict() is used to predict new data.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.