2017年12月7日

tensorflow placeholder

摘要: placeholder 是 Tensorflow 中的占位符,暂时储存变量. Tensorflow 如果想要从外部传入data, 那就需要用到 tf.placeholder(), 然后以这种形式传输数据 sess.run(***, feed_dict={input: **}). 需要传入的值放在了f 阅读全文

posted @ 2017-12-07 10:53 Michael2397 阅读(359) 评论(0) 推荐(0) 编辑

Tensorflow变量

摘要: import tensorflow as tf state = tf.Variable(0, name='counter') # 定义常量 one one = tf.constant(1) # 定义加法步骤 (注: 此步并没有直接计算) new_value = tf.add(state, one) # 将 State 更新成 new_value update = tf.assign(sta... 阅读全文

posted @ 2017-12-07 10:48 Michael2397 阅读(132) 评论(0) 推荐(0) 编辑

tensorflow session会话控制

摘要: Session 是 Tensorflow 为了控制,和输出文件的执行的语句. 运行 session.run() 可以获得你要得知的运算结果, 或者是你所要运算的部分. 阅读全文

posted @ 2017-12-07 10:36 Michael2397 阅读(162) 评论(0) 推荐(0) 编辑

tensorflow第一个例子

摘要: import tensorflow as tf import numpy as np # create data x_data = np.random.rand(100).astype(np.float32) y_data = x_data*0.1 + 0.3 Weights = tf.Variable(tf.random_uniform([1], -1.0, 1.0)) biases = t... 阅读全文

posted @ 2017-12-07 01:56 Michael2397 阅读(149) 评论(0) 推荐(0) 编辑

导航