Tensorflow.js tf.softmax() Function Last Updated : 14 May, 2021 Comments Improve Suggest changes Like Article Like Report Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf.softmax() function is used to compute the softmax normalized vector given the logits. Syntax: tf.softmax (logits, dim?) Parameters: This function accept two parameters which are illustrated below: Logits: the logits array.dim: The dimension softmax would be performed on. Return Value: It returns tf.Tensor Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" const a = tf.tensor1d([3, 1, 3]); a.softmax().print(); Output: Tensor [0.4683105, 0.0633789, 0.4683105] Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" const a = tf.tensor1d([3, 1, 3]); a.softmax().print(); Output: Tensor [[0.9525742, 0.0474259], [0.7310586, 0.2689414], [0.9933072, 0.0066929]] Reference: https://js.tensorflow.org/api/latest/#softmax Comment More infoAdvertise with us Next Article Tensorflow.js tf.softmax() Function D dheerchanana2002 Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.logSoftmax() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. It also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf. 1 min read Tensorflow.js tf.max() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.max() function is used to calculate the maximum value from the specified Tensor across its dimension. It reduces the given inpu 2 min read Tensorflow.js tf.layers.softmax() Function Tensorflow.js is a Google-developed open-source toolkit for executing machine learning models and deep learning neural networks in the browser or on the node platform. It also enables developers to create machine learning models in JavaScript and utilize them directly in the browser or with Node.js. 2 min read Tensorflow.js tf.softplus() Function 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 .softplus() function is used to find softplus of the stated input tensor i.e. log(exp(x) + 1) and is done element w 1 min read Tensorflow.js tf.step() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.step() function is used to return the step of the input tensor's elements i.e. it returns 1 if the element is greater than 0 el 1 min read Tensorflow.js tf.norm() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.norm() function is used compute the norm of matrices, vectors, and scalar. This function can also compute several other vector 2 min read Tensorflow.js tf.maximum() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.maximum() function is used to return the maximum of the two specified tensors element-wise. It supports broadcasting. Syntax: t 2 min read Tensorflow.js tf.min() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.min() function is used to calculate the minimum value from the specified Tensor across its dimension. It reduces the given inpu 2 min read Tensorflow.js tf.oneHot() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.oneHot() function is used to create a one-hot tf.Tensor. The locations represented by indices take the value as 1 (default valu 2 min read Tensorflow.js tf.scalar() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The .scalar() function is used to create a scalar type of tensor means. A scalar is a zero-dimension array and is also called a rank-0 2 min read Like