官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 淮安市| 新闻| 保靖县| 班玛县| 周口市| 嘉定区| 黄陵县| 绥芬河市| 温泉县| 渑池县| 左权县| 冀州市| 胶南市| 桑日县| 汝阳县| 大英县| 汉川市| 江口县| 洛川县| 腾冲县| 兴文县| 恩施市| 逊克县| 长宁区| 乡宁县| 宁晋县| 扶沟县| 教育| 大同县| 彭阳县| 太和县| 错那县| 多伦县| 堆龙德庆县| 德惠市| 喀喇| 固始县| 榆社县| 上饶市| 日土县| 阜康市|