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

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.

主站蜘蛛池模板: 区。| 福清市| 建宁县| 新巴尔虎右旗| 广州市| 务川| 香格里拉县| 永川市| 惠东县| 陇南市| 连城县| 望都县| 麻栗坡县| 平舆县| 镇赉县| 明星| 美姑县| 阳城县| 益阳市| 外汇| 兰溪市| 遂昌县| 集贤县| 普兰县| 神农架林区| 商都县| 荣昌县| 福泉市| 麟游县| 成安县| 西贡区| 金秀| 怀柔区| 稷山县| 东港市| 沁源县| 灯塔市| 南宫市| 于都县| 葫芦岛市| 吴江市|