Python – tensorflow.raw_ops.Acosh()

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. TensorFlow raw_ops proporciona acceso de bajo nivel a todas las operaciones de TensorFlow. Acosh() se usa para encontrar el coseno hiperbólico inverso de x en elementos.

Sintaxis: tf.raw_ops.Acosh(x, nombre)

Argumentos: 

  • x: Es el tensor de entrada. Los tipos permitidos para este tensor son bfloat16, half, float32, float64, complex64, complex128. 
  • name(opcional): Define el nombre de la operación.
     

Devoluciones:  Devuelve un tensor del mismo tipo que x.
 

Nota: Solo toma argumentos de palabras clave.

Ejemplo 1:

Python3

# Importing the library
import tensorflow as tf
  
# Initializing the input tensor
a = tf.constant([1, 2, 3, 4], dtype=tf.float64)
  
# Printing the input tensor
print('Input: ', a)
  
# Calculating Acosh
res = tf.raw_ops.Acosh(x=a)
  
# Printing the result
print('Result: ', res)

Producción:

Input:  tf.Tensor([1. 2. 3. 4.], shape=(4,), dtype=float64)
Result:  tf.Tensor([0.         1.3169579  1.76274717 2.06343707], shape=(4,), dtype=float64)


Ejemplo 2: Visualización

Python3

# importing the library
import tensorflow as tf
import matplotlib.pyplot as plt
  
# Initializing the input tensor
a = tf.constant([1, 2, 3, 4], dtype=tf.float64)
  
# Calculating Acosh
res = tf.raw_ops.Acosh(x=a)
  
# Plotting the graph
plt.plot(a, res, color='green')
plt.title('tensorflow.raw_ops.Acosh')
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 *