Python – tensorflow.math.bessel_i1e() function
TensorFlow is open-source python library designed by Google to develop Machine Learning models and deep learning neural networks. bessel_i1e() is function present in tensorflow math module. This function is used to find element wise exponentially scaled first order modified Bessel function.
Syntax: tensorflow.math.bessel_i1e(x, name)
Arguments:
- x: It’s a tensor and the allowed dtypes for this tensor are bfloat16, half, float32, float64.
- name: It is an optional argument which is used to give operation name.
Returns: It returns a tensor or sparse tensor depending upon x of same dtype as x.
bessel_i1e(x) = exp(-abs(x)) bessel_i1(x)
bessel_i1e(x) is faster and numerically stabler than bessel_i1(x).
Example 1:
Python3
import tensorflow as tf
a = tf.constant([ 1 , 2 , 3 , 4 , 5 ], dtype = tf.float64)
print ( 'a: ' ,a)
r = tf.math.bessel_i1e(a)
print ( "Result: " ,r)
|
Output:
a: tf.Tensor([1. 2. 3. 4. 5.], shape=(5,), dtype=float64)
Result: tf.Tensor([0.20791042 0.21526929 0.19682671 0.17875084 0.16397227], shape=(5,), dtype=float64)
Example 2: Visualization
Python3
import tensorflow as tf
import matplotlib.pyplot as plt
a = tf.constant([ 1 , 2 , 3 , 4 , 5 ], dtype = tf.float64)
r = tf.math.bessel_i1e(a)
plt.plot(a, r, color = 'green' , marker = "o" )
plt.title( "tensorflow.math.bessel_i1e" )
plt.xlabel( "Input" )
plt.ylabel( "Result" )
plt.show()
|
Output:
Last Updated :
22 Feb, 2023
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...