
TensorFlow
牛板筋不筋
温故而知新
展开
-
第3章 会话
1 创建和关闭会话# 创建一个会话。sess = tf.Session()# 使用会话得到之前计算的结果。print(sess.run(result))# 关闭会话使得本次运行中使用到的资源可以被释放。sess.close()2使用 with statement 来创建会话with tf.Session() as sess: print(sess.run(re...原创 2019-09-18 15:47:18 · 135 阅读 · 0 评论 -
第3章 前向传播算法
import tensorflow as tf# #声明 wl w2 两个变盘。这里还通过 seed 参数设定了随机种子,# #这样可以保证每次运行得到的结果是 样的。wl = tf.Variable(tf.random.normal((2, 3) , stddev=1 , seed=1))w2 = tf.Variable(tf.random.normal((3, 1), stddev=...原创 2019-09-18 15:48:17 · 224 阅读 · 0 评论 -
第3章 完整神经网络算法
import tensorflow as tffrom numpy.random import RandomState # 这是随机种子的那个东西# 1定义神经网络的参数,输入和输出节点batch_size = 8w1= tf.Variable(tf.random_normal([2, 3], stddev=1, seed=1))w2= tf.Variable(tf.random...原创 2019-09-18 15:52:36 · 171 阅读 · 0 评论 -
第4章 深层神经网络——4.2.2自定义损失函数
解决问题:判断商品多卖或者少卖对利润的影响import tensorflow as tffrom numpy.random import RandomState#1.定义神经网络的相关参数和变量batch_size = 8x = tf.placeholder(tf.float32, shape=(None, 2), name="x-input")y_ = tf.placehol...原创 2019-10-10 16:36:27 · 305 阅读 · 0 评论 -
第4章 深层神经网络——4.4.3滑动平局模型
import tensorflow as tfv1 = tf.Variable(0, dtype=tf.float32)step = tf.Variable(0, trainable=False)ema = tf.train.ExponentialMovingAverage(0.99, step)maintain_averages_op = ema.apply([v1])with ...原创 2019-10-10 16:44:47 · 132 阅读 · 0 评论 -
第5章 MNIST数字识别问题——全模型
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataINPUT_NODE = 784 # 输入节点OUTPUT_NODE = 10 # 输出节点LAYER1_NODE = 500 # 隐藏层数BATCH_SIZE = 100 # 每次batch打包的样本个数# ...原创 2019-10-10 16:49:55 · 205 阅读 · 0 评论 -
TF学习中 见到不错的博客
《Tensorflow 实战google深度学习框架》第二版 的 程序源代码存放地址https://blog.youkuaiyun.com/qq_23031939/article/details/80056682深度学习TensorFlow优化器的选择https://blog.youkuaiyun.com/junchengberry/article/details/81102058Tensor...原创 2019-10-11 17:19:21 · 102 阅读 · 0 评论