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

Variables

Variables are the containers used to store values. Variables will be used as input to several other operations in the computational graph. We can create TensorFlow variables using the tf.Variable() function. In the following example, we define a variable with values from a random normal distribution and name it weights:

weights = tf.Variable(tf.random_normal([3, 2], stddev=0.1), name="weights")

However, after defining a variable, we need to explicitly create an initialization operation using the tf.global_variables_initializer() method which will allocate resources for the variable.

主站蜘蛛池模板: 汉寿县| 新余市| 化州市| 广平县| 宁武县| 吐鲁番市| 同仁县| 永安市| 元朗区| 旺苍县| 遂昌县| 库车县| 大丰市| 乌兰县| 平阴县| 绥江县| 北川| 平邑县| 昌宁县| 灵武市| 高平市| 钟祥市| 积石山| 鄂托克前旗| 黑龙江省| 什邡市| 同心县| 广德县| 叶城县| 乌鲁木齐县| 宿州市| 淮南市| 海林市| 盘山县| 海兴县| 乐亭县| 梨树县| 庆安县| 黄大仙区| 剑阁县| 江山市|