HomeLanguagesPython – tensorflow.math.lbeta()

Python – tensorflow.math.lbeta()

TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. 

lbeta() is used to compute ln(|Beta(x)|). It reduces the tensor along the last dimension. If one-dimensional z is [z1, …, zk], then Beta(z) is defined as

If x is n+1 dimensional tensor with shape [N1 , . . ., Nn , k], last dimension is treated as z vector and,

If z = [u, v] then traditional bivariate beta function is defined as 

Syntax: tensorflow.math.lbeta( x, name)

Parameters:

  • x: It’s the input tensor with rank n+1 where n>=0. Allowed dtypes  are float, or double.
  • name(optional): It defines the name for the operation.

Returns:

It returns the logarithm of |Beta(x)| reducing along the last dimension. 

Example 1:

Python3




# Importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([[7, 8], [13, 11]], dtype = tf.float64)
 
# Printing the input tensor
print('a: ', a)
 
# Calculating the result
res = tf.math.lbeta(x = a)
 
# Printing the result
print('Result: ', res)


Output:

a:  tf.Tensor(
[[ 7.  8.]
 [13. 11.]], shape=(2, 2), dtype=float64)
Result:  tf.Tensor([-10.08680861 -16.5150485 ], shape=(2, ), dtype=float64)

Example 2:

Python3




# Importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([7, 8, 13, 11], dtype = tf.float64)
 
# Printing the input tensor
print('a: ', a)
 
# Calculating the result
res = tf.math.lbeta(x = a)
 
# Printing the result
print('Result: ', res)


Output:

a:  tf.Tensor([ 7.  8. 13. 11.], shape=(4, ), dtype=float64)
Result:  tf.Tensor(-52.77215897270088, shape=(), dtype=float64)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32688 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7057 POSTS0 COMMENTS
Nicole Veronica
12198 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12293 POSTS0 COMMENTS
Shaida Kate Naidoo
7182 POSTS0 COMMENTS
Ted Musemwa
7447 POSTS0 COMMENTS
Thapelo Manthata
7160 POSTS0 COMMENTS
Umr Jansen
7150 POSTS0 COMMENTS