Tensorflow.js tf.sigmoid() Function Last Updated : 12 May, 2021 Comments Improve Suggest changes Like Article Like Report Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .sigmoid() function is used to find the sigmoid of the stated tensor input i.e. 1 / (1 + exp(-x)) and is done element wise. Syntax: tf.sigmoid(x) Parameters: This function accepts single parameter which are illustrated below: x: It is the tensor input and it can be of type tf.Tensor, or TypedArray, or Array. Return Value: It returns the tf.Tensor object. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Defining tensor input elements const y = tf.tensor1d([-1, 15, 0, Math.E-1]); // Calling sigmoid() method and // printing output y.sigmoid().print(); Output: Tensor [0.2689414, 0.9999996, 0.5, 0.8479074] Example 2: In this example, the parameter is passed directly to the sigmoid function. JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Defining float values var val = [0.5, -1.5, .66]; // Calling tensor1d method const y = tf.tensor1d(val); // Calling sigmoid() method var res = tf.sigmoid(y) // Printing output res.print(); Output: Tensor [0.6224594, 0.1824255, 0.6592603] Comment More infoAdvertise with us Next Article Tensorflow.js tf.sigmoid() Function nidhi1352singh Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.logSigmoid() Function Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .logSigmoid() function is used to find the log sigmoid of the stated tensor input and is done element wise. S 1 min read Tensorflow.js tf.model() 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 tf.model() function is used to create a model which contains layers and layers that are provided in form of input a 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.sin() Function Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .sin() function is used to find the sin of the stated tensor input, and it is done element wise. Syntax : Â t 2 min read Tensorflow.js tf.sum() 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.sum() function is used to calculate sum of the elements of a specified Tensor across its dimension. It reduces the given input 2 min read Tensorflow.js tf.sinh() function Tensorflow.js is an open-source library which is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .sinh() function is used to find the hyperbolic sin of the stated tensor input and is done elements wise. Sy 2 min read Tensorflow.js tf.prod() 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.prod() function is used to calculate product of the elements of a specified Tensor across its dimension. It reduces the given i 2 min read Tensorflow.js tf.tensor2d() 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 .tensor2d() function is used to create a new 2-dimensional tensor with the parameter namely value, shape, and datatype. Syntax: tf 3 min read Tensorflow.js tf.neg() Function Tensorflow.js is an open-source library which is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .neg() function is used to calculate -1 * x i.e. input tensor and is done element wise. Syntax: Â tf.neg(x) 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 Like