HomeLanguagesPython – tensorflow.math.ndtri()

Python – tensorflow.math.ndtri()

TensorFlow is open-source python library designed by Google to develop Machine Learning models and deep learning  neural networks. ndtri() is used to find quantile of Standard Normal.

Syntax: tf.math.ndtri(x, name)

Parameter:

  • x: It’s the input tensor. Allowed dtype for this tensor are float or double..
  • name(optional): It defines the name for the operation.

Returns: It returns Inverse error function of x.

Example 1:

Python3




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


Output:

Input:  tf.Tensor([0.2 0.5 0.7 1. ], shape=(4, ), dtype=float64)
Result:  tf.Tensor([-0.84162123  0.          0.52440051         inf], shape=(4, ), dtype=float64)

Example 2:

Python3




# importing the library
import tensorflow as tf
 
# Initializing the input tensor
a = tf.constant([-.1, -.2, -.5, .5, .2, .1], dtype = tf.float64)
 
# Printing the input tensor
print('Input: ', a)
 
# Calculating result
res = tf.math.ndtri(x = a)
 
# Printing the result
print('Result: ', res)


Output:

Input:  tf.Tensor([-0.1 -0.2 -0.5  0.5  0.2  0.1], shape=(6, ), dtype=float64)
Result:  tf.Tensor([       -inf        -inf        -inf  0.         -0.84162123 -1.28155157], shape=(6, ), dtype=float64)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32675 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
7043 POSTS0 COMMENTS
Nicole Veronica
12182 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12277 POSTS0 COMMENTS
Shaida Kate Naidoo
7166 POSTS0 COMMENTS
Ted Musemwa
7436 POSTS0 COMMENTS
Thapelo Manthata
7140 POSTS0 COMMENTS
Umr Jansen
7133 POSTS0 COMMENTS