Tensorflow.js tf.LayersModel class .predict() Method
Tensorflow.js is an open-source library that is developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment.
The .predict() function is used to produce the output estimates for the given input instances. Moreover, the calculations here are made in sets. Where, the step operation is not supportive at present as core backend of tensorflow.js is only required.
- x: It is the stated input data, like a Tensor, otherwise an array of tf.Tensors in case the model has various inputs. It can be of type tf.Tensor, or tf.Tensor.
- args: It is the stated ModelPredictArgs object that holds elective fields.
- batchSize: It is the stated batch dimension which is of type integer. In case its undefined, the by default value will be 32.
- verbose: It is the stated verbosity mode whose by default value is false.
Return Value: It returns the tf.Tensor object or tf.Tensor.
Tensor [[-0.7650393, -0.8317917], [-0.7274997, 1.827635 ], [-0.9398478, -0.2998275], [-1.0945926, -1.9154934], [0.0067322 , -1.9220339], [0.2052939 , 0.6488774 ]]
Tensor [[0.2670097, -1.2741219, -0.3159108], [0.9108799, -0.1305539, -0.1370454]]