- 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.
推薦閱讀
- MySQL高可用解決方案:從主從復(fù)制到InnoDB Cluster架構(gòu)
- Word 2010中文版完全自學(xué)手冊
- SQL Server入門經(jīng)典
- Voice Application Development for Android
- 新型數(shù)據(jù)庫系統(tǒng):原理、架構(gòu)與實(shí)踐
- Learning JavaScriptMVC
- Creating Dynamic UIs with Android Fragments(Second Edition)
- 數(shù)據(jù)庫原理與應(yīng)用(Oracle版)
- 跟老男孩學(xué)Linux運(yùn)維:MySQL入門與提高實(shí)踐
- 網(wǎng)站數(shù)據(jù)庫技術(shù)
- 跨領(lǐng)域信息交換方法與技術(shù)(第二版)
- Chef Essentials
- Spark分布式處理實(shí)戰(zhàn)
- Visual Studio 2013 and .NET 4.5 Expert Cookbook
- Gideros Mobile Game Development