Python – función tensorflow.math.bessel_i1e()

TensorFlow es una biblioteca de Python de código abierto diseñada por Google para desarrollar modelos de aprendizaje automático y redes neuronales de aprendizaje profundo. bessel_i1e() es una función presente en el módulo matemático tensorflow. Esta función se utiliza para encontrar elementos de la función de Bessel modificada de primer orden exponencialmente escalada.

Sintaxis: tensorflow.math.bessel_i1e(x, nombre)

Argumentos:

  • x: Es un tensor y los dtypes permitidos para este tensor son bfloat16, half, float32, float64.
  • nombre: es un argumento opcional que se usa para dar el nombre de la operación.

Devoluciones: Devuelve un tensor o tensor disperso dependiendo de x del mismo tipo que x.

bessel_i1e(x) = exp(-abs(x)) bessel_i1(x)

bessel_i1e(x) is faster and numerically stabler than bessel_i1(x).


Ejemplo 1:

Python3

# importing the library
import tensorflow as tf
  
# initializing the input
a = tf.constant([1,2,3,4,5], dtype = tf.float64)
  
# printing the input 
print('a: ',a)
  
# evaluating the result
r = tf.math.bessel_i1e(a)
  
# printing the result
print("Result: ",r)

Producción:

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)

Ejemplo 2: Visualización

Python3

# importing the library
import tensorflow as tf
import matplotlib.pyplot as plt 
  
# initializing the input
a = tf.constant([1,2,3,4,5], dtype = tf.float64)
  
# evaluating the result
r = tf.math.bessel_i1e(a)
  
#plotting the graph
plt.plot(a, r, color = 'green', marker = "o")  
plt.title("tensorflow.math.bessel_i1e")  
plt.xlabel("Input")  
plt.ylabel("Result")  
plt.show() 

Producción:

Publicación traducida automáticamente

Artículo escrito por aman neekhara y traducido por Barcelona Geeks. The original can be accessed here. Licence: CCBY-SA

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *