TensorFlow ist eine Open-Source-Python-Bibliothek, die von Google entwickelt wurde, um Modelle für machine learning und neuronale Netzwerke für deep learning zu entwickeln.

Funktion fresnel_cos()

fresnel_cos() wird verwendet, um das elementweise Fresnel- Kosinusintegral von x zu berechnen. Es ist definiert als das Integral von cos (t ^ 2) von 0 bis x, wobei der Definitionsbereich alle positiven reellen Zahlen sind.

Sytnax: tensorflow.math.special.fresnel_cos (x, name)

Parameter:

  • x: Es ist ein Tensor oder ein spärlicher Tensor. Zulässige dtypes sind float32 und float64.
  • name (optional): Definiert den Namen für die Operation.

Rückgabe : Es wird ein Tensor vom gleichen Typ wie x zurückgegeben.



Beispiel 1:

import tensorflow as tf 
  
a = tf.constant([ [-5, -7],[ 2, 0]], dtype=tf.float64) 
  
print('a: ', a) 
  
res = tf.math.special.fresnel_cos(a) 
  
print('Result: ', res) 

Ausgabe:

a: tf.Tensor (
[[-5. -7.]
 [2. 0.]], Form = (2, 2), dtype = float64)
Ergebnis: tf.Tensor (
[[-0.56363119 -0.54546709]
 [0.48825341 0.]], Form = (2, 2), dtype = float64)

Beispiel 2:

import tensorflow as tf 
  
a = tf.constant([1, 2, 3, 4, 5], dtype=tf.float64) 
  
print('a: ', a) 
  
res = tf.math.special.fresnel_cos(a) 
  
print('Result: ', res) 

Ausgabe:

a: tf.Tensor ([1. 2. 3. 4. 5.], Form = (5,), dtype = float64)
Ergebnis: tf.Tensor ([0.7798934 0.48825341 0.60572079 0.49842603 0.56363119], Form = (5,) , dtype = float64)