Tensorflow.js tf.softplus() Function Last Updated : 18 May, 2021 Comments Improve Suggest changes Like Article Like Report 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 wise. Syntax : tf.softplus(x) Parameters: x: It is the stated tensor input, and it can be of type tf.Tensor, 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([11, 17, 0, NaN, -41]); // Calling softplus() method and // Printing output y.softplus().print(); Output: Tensor [11.0000162, 17, 0.6931472, NaN, 0] Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Defining tensor input var val = [1.5, .4, .23, null, 'a']; // Calling tensor1d method const y = tf.tensor1d(val); // Calling softplus() method var res = tf.softplus(y) // Printing output res.print(); Output: Tensor [1.7014132, 0.9130152, 0.8147451, 0.6931472, NaN] Reference: https://js.tensorflow.org/api/latest/#softplus Comment More infoAdvertise with us Next Article Tensorflow.js tf.softplus() Function nidhi1352singh Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads 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.selu() 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 .selu() function is used to find the scaled exponential linear and is done element wise. Syntax: Â tf.selu(x) Where 1 min read Tensorflow.js tf.prelu() 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 .prelu() function is used to find leaky rectified linear of the stated tensor input along with parametric alphas an 2 min read Tensorflow.js tf.ones() Function Tensorflow.js is an open-source library for running machine learning models and deep learning neural networks in the browser or node environment. The tf.ones() function is used to create a new tensor where all elements are set to 1. Syntax: tf.ones(shape, dtype, name) Parameters: shape: It takes the 2 min read Tensorflow.js tf.pad() 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. 2 min read Tensorflow.js tf.stack() 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 helps developers to develop ML models in JavaScript, and use ML directly in the browser or in Node.js. The tf.stack() function is u 2 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.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.pow() 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.pow() function is used to compute the power of one specified tensor to another. It supports broadcasting. Syntax: tf.power(base 1 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 Like