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

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.

主站蜘蛛池模板: 民县| 桂东县| 稷山县| 河曲县| 黑水县| 蓬安县| 富裕县| 三明市| 扶余县| 灵石县| 东乡| 扎兰屯市| 白朗县| 忻城县| 敦化市| 留坝县| 靖宇县| 天门市| 衡南县| 张家口市| 清远市| 峨山| 通化市| 泾阳县| 堆龙德庆县| 焉耆| 潞城市| 江孜县| 融水| 凤台县| 常宁市| 南京市| 新乡县| 镶黄旗| 城市| 林周县| 江油市| 中西区| 北流市| 赞皇县| 白河县|