Python – tensorflow.math.bessel_i0e() function

TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. bessel_i0e() is function present in tensorflow math module. This function is used to find element wise exponentially scaled modified 0 order Bessel function.
bessel_i0e(x) = exp(-abs(x)) bessel_i0(x) bessel_i0e(x) is faster and numerically stabler than bessel_i0(x).
Syntax: tensorflow.math.bessel_i0e( x, name)
Parameters:
- 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.
Example 1:
Python3
# importing the libraryimport tensorflow as tf# initializing the inputa = tf.constant([1,2,3,4,5], dtype = tf.float64)# printing the input print('a: ',a)# evaluating the resultr = tf.math.bessel_i0e(a)# printing the resultprint("Result: ",r) |
Output:
a: tf.Tensor([1. 2. 3. 4. 5.], shape=(5,), dtype=float64) Result: tf.Tensor([0.46575961 0.30850832 0.24300035 0.20700192 0.18354081], shape=(5,), dtype=float64)
Example 2: Visualization
Python3
# importing the libraryimport tensorflow as tfimport matplotlib.pyplot as plt # initializing the inputa = tf.constant([1,2,3,4,5], dtype = tf.float64)# evaluating the resultr = tf.math.bessel_i0e(a)#plotting the graphplt.plot(a, r, color = 'green', marker = "o") plt.title("tensorflow.math.bessel_i0e") plt.xlabel("Input") plt.ylabel("Result") plt.show() |
Output:




