
Tensorflow教程
铿锵的玫瑰
业余爱好者
展开
-
MNIST进阶研究
加载MNIST数据构建Softmax 回归模型占位符变量类别预测与损失函数训练模型评估模型权重初始化卷积和池化第一层卷积第二层卷积密集连接层Dropout输出层训练和评估模型...原创 2019-06-09 15:15:22 · 195 阅读 · 0 评论 -
运行TensorFlow无法打开libcuda.so.1
方案一执行如下命令sudo apt-get install cuda-drivers方案二原创 2019-07-06 08:59:56 · 3283 阅读 · 0 评论 -
Ubuntu更新完NVIDIA驱动后,一直处于登录界面
方案一参考网址https://blog.youkuaiyun.com/autocyz/article/details/51818737https://blog.youkuaiyun.com/blankwind/article/details/82529847原创 2019-07-06 09:02:12 · 4012 阅读 · 0 评论 -
ubuntu16.04启动Anaconda Navigator 图形化界面
原创 2019-07-06 09:03:28 · 641 阅读 · 0 评论 -
linux下Anaconda的安装
参考网址https://blog.youkuaiyun.com/qq1483661204/article/details/78201451原创 2019-07-06 09:07:11 · 488 阅读 · 0 评论 -
Linux下Pycharm Professional激活
激活码 第一个激活码 MTW881U3Z5-eyJsaWNlbnNlSWQiOiJNVFc4ODFVM1o1IiwibGljZW5zZWVOYW1lIjoiTnNzIEltIiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ug...原创 2019-07-06 09:14:51 · 16534 阅读 · 6 评论 -
Tensorflow线性回归实例
代码import tensorflow as tfimport numpy as npx_data = np.random.rand(100).astype(np.float32)y_data = x_data*0.5 + 0.7Weights = tf.Variable(tf.random_uniform([1], -1.0, 1.0))Biases = tf.Variable...原创 2019-05-10 09:20:34 · 181 阅读 · 0 评论 -
Batch Normalization的实例
代码import numpy as npimport tensorflow as tfimport matplotlib.pyplot as pltACTIVATION = tf.nn.reluN_LAYERS = 7N_HIDDEN_UNITS = 30def fix_seed(seed=1): # reproducible np.random.seed...原创 2019-05-20 21:40:28 · 861 阅读 · 0 评论 -
基于Tensorflow的可视化梯度下降
代码import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3DLR = 0.1REAL_PARAMS = [1.2, 2.5]INIT_PARAMS = [[5, 4], [5, 1],...原创 2019-05-20 22:53:58 · 590 阅读 · 0 评论 -
tensorboard的可视化实例
代码import tensorflow as tfimport numpy as npdef add_layer(inputs, in_size, out_size, activation_function=None): with tf.name_scope("layer"): with tf.name_scope("weight"): ...原创 2019-05-17 11:41:29 · 1007 阅读 · 1 评论 -
基于Tensorflow的手写文字的识别
代码import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_dataimport numpy as npdef add_layer(inputs, in_size, out_size, activation_function=None): Weights = tf.Variabl...原创 2019-05-17 20:37:43 · 1060 阅读 · 0 评论 -
Dropout解决OverFitting
代码import tensorflow as tffrom sklearn.datasets import load_digitsfrom sklearn.model_selection import train_test_splitfrom sklearn.preprocessing import LabelBinarizer# load datadigits = load_d...原创 2019-05-17 21:58:50 · 667 阅读 · 0 评论 -
基于RNN的scope使用
代码import tensorflow as tfclass TrainConfig: batch_size = 20 time_steps = 20 input_size = 10 output_size = 2 cell_size = 11 learning_rate = 0.01class TestConfig(TrainCon...原创 2019-05-20 20:52:02 · 222 阅读 · 0 评论 -
不同scope的命名方式比较
代码import tensorflow as tfwith tf.name_scope("a_name_scope"): initializer = tf.constant_initializer(value=1) var1 = tf.get_variable(name='var1', shape=[1], dtype=tf.float32, initializer=in...原创 2019-05-20 20:51:21 · 224 阅读 · 0 评论 -
非监督学习的自编码器实例
代码import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt# Import MNIST datafrom tensorflow.examples.tutorials.mnist import input_datamnist = input_data.read_data_sets("/tmp/...原创 2019-05-20 20:29:59 · 492 阅读 · 0 评论 -
tensorflow的Session控制
代码import tensorflow as tfmatrix1 = tf.constant([[3, 3]])matrix2 = tf.constant([[2], [2]])product = tf.matmul(matrix1, matrix2)### method1# sess = tf.Session()# result ...原创 2019-05-10 09:47:55 · 287 阅读 · 0 评论 -
TensorFlow的Variable变量应用
代码import tensorflow as tfstate = tf.Variable(0, name='counter')print(state.name)one = tf.constant(1)new_value = tf.add(state, one)update = tf.assign(state, new_value)init = tf.global_varia...原创 2019-05-10 10:00:20 · 203 阅读 · 0 评论 -
Tensorflow的Placeholder传入值
代码import tensorflow as tfinput1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32)output = tf.multiply(input1, input2)with tf.Session() as sess: print(sess.run(output, feed_...原创 2019-05-10 10:12:49 · 681 阅读 · 0 评论 -
TensorFlow之建造神经网络
代码import tensorflow as tfimport numpy as npdef add_layer(inputs, in_size, out_size, activation_function=None): Weights = tf.Variable(tf.random_normal([in_size, out_size])) biases = tf.Va...原创 2019-05-10 11:39:48 · 160 阅读 · 0 评论 -
简单的CNN架构
代码import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data# number 1 to 10 datamnist = input_data.read_data_sets('MNIST_data', one_hot=True)def compute_accuracy(v_xs, ...原创 2019-05-20 14:55:26 · 267 阅读 · 0 评论 -
神经网络的保存与读取实例
代码import tensorflow as tfimport 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 = ...原创 2019-05-20 15:06:16 · 907 阅读 · 0 评论 -
LSTM神经网络实例
代码import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data# set random seed for comparing the two result calculationstf.set_random_seed(1)# this is datamnist = input...原创 2019-05-20 16:13:59 · 2573 阅读 · 0 评论 -
基于LSTM的网络的波形预测回归
代码import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltBATCH_START = 0TIME_STEPS = 20BATCH_SIZE = 50INPUT_SIZE = 1OUTPUT_SIZE = 1CELL_SIZE = 10LR = 0.006def get_bat...原创 2019-05-20 17:50:17 · 1847 阅读 · 0 评论 -
基于Tensorflow的简单线性方程拟合
代码import tensorflow as tfimport numpy as np# 使用 NumPy 生成假数据(phony data), 总共 100 个点.x_data = np.float32(np.random.rand(2, 100)) # 随机输入y_data = np.dot([0.100, 0.200], x_data) + 0.300# 构造一个线性模型...原创 2019-06-07 15:37:09 · 203 阅读 · 0 评论 -
MNIST数据集下载
参考网址:http://yann.lecun.com/exdb/mnist/http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gzhttp://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gzhttp://yann.lecun.com/exdb/mnist/t10...原创 2019-06-07 18:10:38 · 40739 阅读 · 5 评论