Tensorflow.js tf.log() 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 .log() function is used to find the natural logarithm of the stated tensor input i.e. ln(x) and is done element wise.
Parameters: This function accepts three parameters 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.
Tensor [0, 2.7080503, 3.6375861, 0.9999999]
Example 2: In this example, the parameter is passed directly to the log function.
Tensor [-0.6931472, 0.4054651, -0.4155154]