![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
深度学习
Sr's man
这个作者很懒,什么都没留下…
展开
-
TersorFlow——入门
计算图import tensorflow as tfa = tf.constant([1.0,2.0],name="a")b = tf.constant([2.0,3.0],name="b")result = a+b#tf.get_default_graph()获取当前默认的计算图#可以通过a.graph查看张量所属的计算图。因为没有指定所以这个计算图应该等于当前默认的计算图。p...原创 2019-01-17 22:46:34 · 804 阅读 · 0 评论 -
深层神经网络
TensorFlow实战Google深度学习框架学习笔记 1.通过激活函数实现去线性化对于线性不可分的数据集,可以通过激活函数对神经网络模型去线性化。常见的激活函数有:ReLU函数:f(x) = max(x,0)sigmoid函数:$ f(x) = \frac{1}{1+e^{-x}}$tanh函数:$ f(x) = \frac {1-e{-2x}}{1+e{2x}} $Te...原创 2019-01-24 17:24:32 · 123 阅读 · 0 评论 -
神经网络参数与TensorFlow变量
TensorFlow实战Google深度学习框架学习笔记 import tensorflow as tf# TensorFlow声明一个矩阵变量的方法weights = tf.Variable(tf.random_normal([2,3],stddev = 2))TensorFlow 随机数生成函数函数名称随机数分布主要参数tf.random_normal正...原创 2019-01-24 17:30:36 · 166 阅读 · 0 评论 -
模型持久化
为了让训练好模型可以复用,需要将神经网络结果持久化。TensorFlow提供了一个简单的API来保存和恢复神经网络模型。这个API是tf.train.Saver.# 保存TensorFlow计算图的方法import tensorflow as tf#声明两个变量并计算他们的和v1 = tf.Variable(tf.constant(1.0, shape=[1]), name = 'v...原创 2019-02-01 09:42:35 · 319 阅读 · 0 评论 -
TensorFlow_MNIST数字识别问题
import tensorflow as tf#导入MNIST的训练和测试数据from tensorflow.examples.tutorials.mnist import input_datatensorflow中通过input_data.read_data_sets函数生成一个类会将MNIST数据划分为train、validation和test三个数据集。在本例中input_dat...原创 2019-02-01 09:44:44 · 187 阅读 · 0 评论 -
TensorFlow_变量管理
TensorFlow提供了一种通过变量名称来创建或者获取一种变量的机制。通过变量直接创建和获取变量tf.get_variable 和 tf.variable_scope 函数实现。import tensorflow as tf1.利用tf.get_variable创建和获取变量。使用tf.get_variable来创建一个变量:# 下面这两个定义是等价的。v = tf.get_vari...原创 2019-02-01 09:54:34 · 122 阅读 · 0 评论