
Tensorflow
还是那个同伟伟
百万代码中取bug首级
展开
-
深度学习框架TensorFlow(3.变量)
1.先看代码:import tensorflow as tf#定义变量x = tf.Variable([1,2])#定义常量a = tf.constant([3,3])#增加一个减法的opsub = tf.subtract(x,a)#增加一个减法opadd = tf.add(x,sub)#初始化所有的变量init = tf.global_variables_initialize...原创 2018-06-03 18:14:50 · 180 阅读 · 0 评论 -
深度学习框架TensorFlow(4.Fetch and Feed)
1.Fetch :可以在会话里可以同时执行多个op,然后得到运行结果 fetch:例子(直接看代码)import tensorflow as tf#定义三个常量input1 = tf.constant(3.0)input2 = tf.constant(2.0)input3 = tf.constant(5.0)#加法的操作add = tf.add(input2,input3)#乘法...原创 2018-06-05 20:57:28 · 226 阅读 · 0 评论