![Neural Network Programming with TensorFlow](https://wfqqreader-1252317822.image.myqcloud.com/cover/537/36700537/b_36700537.jpg)
上QQ阅读APP看书,第一时间看更新
Determinant
Determinant shows us information about the matrix that is helpful in linear equations and also helps in finding the inverse of a matrix.
For a given matrix X, the determinant is shown as follows:
![](https://epubservercos.yuewen.com/CB0D7A/19470401501607606/epubprivate/OEBPS/Images/04084fab-c318-4f21-960f-c326eee557b0.jpg?sign=1739137908-S1bi0MOmbg5lpGoU5yOyMkjYhy3jr2UB-0-a4b83da52f1a0206509fe502c89ad5ee)
![](https://epubservercos.yuewen.com/CB0D7A/19470401501607606/epubprivate/OEBPS/Images/ce5ff6f2-7d96-45d5-ab7a-c1e956c44634.jpg?sign=1739137908-kpCcZL4eZowYYECDyjj9h46NK6pFeMw2-0-aa83fd18795e3ab346fb3f0088596484)
The following example shows how to get a determinant using TensorFlow:
import tensorflow as tf
import numpy as np
x = np.array([[10.0, 15.0, 20.0], [0.0, 1.0, 5.0], [3.0, 5.0, 7.0]], dtype=np.float32)
det = tf.matrix_determinant(x)
with tf.Session() as sess:
print(sess.run(det))
The output of this is shown as follows:
-15.0