
Tensorflow从入门到实战
从入门到实战课程tensorflow
黑洲非人lyf
小码农
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Tensorflow入门到实战六(保存网络和加载网络)
保存网络 import tensorflow as tf import numpy as np # Save to file # remember to define the same dtype and shape when restore W = tf.Variable([[1,2,3],[3,4,5]], dtype=tf.float32, name='weights') b = tf...原创 2019-03-01 18:18:47 · 545 阅读 · 0 评论 -
Tensorflow入门到实战五(卷积神经网络)
方法定义tf.nn.conv2d (input, filter, strides, padding, use_cudnn_on_gpu=None, data_format=None, name=None) 参数:**input : ** 输入的要做卷积的图片,要求为一个张量,shape为 [ batch, in_height, in_weight, in_channel ],其中batch为图片...原创 2019-02-28 22:56:52 · 386 阅读 · 0 评论 -
Tensorflow入门到实战四(识别手写数字集mnist)
手写数字集mnist 任然是集合作为特征数*样本数,特征数代表了某层神经元数量 wx_plus_b = tf.nn.dropout(wx_plus_b,keep_prob) dropout可以解决过拟合 def add_layer(inputs,in_size,out_size,activation_function=None): Weights = tf.Variable(tf...原创 2019-02-28 14:22:46 · 280 阅读 · 0 评论 -
Tensorflow入门到实战 拓展(Tensorflow常用函数)
tf.argmax axis y_pre = [[5,1,1,0,1],[2,3,-4,5,6]] session.run(tf.arg_max(y_pre,1)) array([0, 4], dtype=int64) y_pre session.run(tf.arg_max(y_pre,0)) array([0, 1, 0, 1, 1], dtype=in...原创 2019-02-27 21:47:44 · 273 阅读 · 0 评论 -
Tensorflow入门到实战三(构造简单的神经网络)
1:tf.random_normal: 正态分布产生的随机值:常用的参数就是shape,和dtype了,但是也包括方差和均值; 参数(shape,stddev,mean,dtype) 2:tf.random_uniform 默然是在0到1之间产生随机数: 但是也可以通过maxval指定上界,通过minval指定下界 np.newaxis 的实用 np.newaxis 在使用和功能上...原创 2019-02-27 16:48:21 · 303 阅读 · 0 评论 -
Tensorflow入门到实战一(变量与常量/placeholder)
变量与常量 import tensorflow as tf ## 定义 #定义一个变量 var =tf.Variable(0,name="myvar") #定义一个常量 con_var=tf.constant(1) #定义一个加法 new_var=tf.add(var,con_var) ## 开始计算 #初始化,在初始化之前是变量是没有值的 init =tf.global_vari...原创 2019-02-26 15:12:03 · 448 阅读 · 0 评论 -
Tensorflow入门到实战二(求解线性回归)
求解线性回归 代码块如下 import tensorflow as tf import numpy as np x_data = np.random.rand(100).astype(np.float32) y_data = 0.1*x_data +0.3 print(tf.random_uniform([1],-1,1)) weights = tf.Variable(tf.random_...原创 2019-02-25 18:44:08 · 317 阅读 · 0 评论