Example 1Lesson 24Free preview
Ex1 Data
This lesson is part of A.I. · All levels
Summary
The data in TensorFlow.js is made tensor with tf.tensor1d for vectors and tf.tensor2d for matrices. The neat data makes models easy to train and the results easy to read. In a simple prediction example, x is the input tensor and y is the expected output tensor.
Key points
- Tf.tensor1d makes the tensor one-dimensional (vector).
- Tf.tensor2d makes a two-dimensional tensor (line matrix × column).
- Each pair (x, y) is a single instance of data: features and expected output.
- The shape property indicates the dimensions of a tensor.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.