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

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.

主站蜘蛛池模板: 安新县| 大埔区| 商水县| 嘉黎县| 灵宝市| 康平县| 安岳县| 滕州市| 阳泉市| 色达县| 淮南市| 宜良县| 枣庄市| 白水县| 凤台县| 清新县| 瑞安市| 华宁县| 大庆市| 金溪县| 平果县| 中方县| 福贡县| 怀柔区| 山西省| 灵寿县| 涿州市| 平阳县| 开鲁县| 东台市| 兴化市| 客服| 安徽省| 阜阳市| 沛县| 新乡市| 呼玛县| 溧阳市| 八宿县| 麻城市| 鄂伦春自治旗|