- Neural Network Programming with TensorFlow
- Manpreet Singh Ghotra Rajdeep Dua
- 82字
- 2021-07-02 15:17:07
Vectors
The Norm function is used to get the size of the vector; the norm of a vector x measures the distance from the origin to the point x. It is also known as the norm, where p=2 is known as the Euclidean norm.
The following example shows you how to calculate the norm of a given vector:
import tensorflow as tf
vector = tf.constant([[4,5,6]], dtype=tf.float32)
eucNorm = tf.norm(vector, ord="euclidean")
with tf.Session() as sess:
print(sess.run(eucNorm))
The output of the listing is 8.77496.
推薦閱讀
- SQL Server 2012數(shù)據(jù)庫技術(shù)與應用(微課版)
- 大數(shù)據(jù)時代下的智能轉(zhuǎn)型進程精選(套裝共10冊)
- Microsoft Power BI數(shù)據(jù)可視化與數(shù)據(jù)分析
- 中國數(shù)字流域
- SQL優(yōu)化最佳實踐:構(gòu)建高效率Oracle數(shù)據(jù)庫的方法與技巧
- 基于OPAC日志的高校圖書館用戶信息需求與檢索行為研究
- MATLAB Graphics and Data Visualization Cookbook
- R語言數(shù)據(jù)挖掘
- 聯(lián)動Oracle:設計思想、架構(gòu)實現(xiàn)與AWR報告
- R Machine Learning Essentials
- Spring Boot 2.0 Cookbook(Second Edition)
- 數(shù)據(jù)庫原理與設計實驗教程(MySQL版)
- Swift Functional Programming(Second Edition)
- 大數(shù)據(jù)隱私保護技術(shù)與治理機制研究
- Delphi High Performance