書名: Neural Network Programming with TensorFlow作者名: Manpreet Singh Ghotra Rajdeep Dua本章字數: 68字更新時間: 2021-07-02 15:17:08
Identity matrix
An identity matrix is a matrix I that does not change any vector, like V, when multiplied by I.
The following example shows how to get the identity matrix for a given size:
import tensorflow as tf
identity = tf.eye(3, 3)
with tf.Session() as sess:
print(sess.run(identity))
The output of this is shown as follows:
[[ 1. 0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]]
推薦閱讀
- MySQL高可用解決方案:從主從復制到InnoDB Cluster架構
- SQL Server 2016 數據庫教程(第4版)
- SQL Server 2008數據庫應用技術(第二版)
- 文本數據挖掘:基于R語言
- 文本挖掘:基于R語言的整潔工具
- 一個64位操作系統的設計與實現
- 從0到1:JavaScript 快速上手
- 數據科學工程實踐:用戶行為分析與建模、A/B實驗、SQLFlow
- Apache Kylin權威指南
- MySQL數據庫技術與應用
- R Machine Learning Essentials
- Node.js High Performance
- 大數據技術體系詳解:原理、架構與實踐
- 數據庫基礎與應用
- 數據庫原理及應用實驗:基于GaussDB的實現方法