随笔分类 - tensorflow
摘要:下面是训练的结果 这里边有一个死循环,具体怎么回事我也不太清楚。 下边是可视化训练,展示训练的图像
阅读全文
摘要:下面是训练的结果,需要等到所有的机器都开起来之后才能进行训练
阅读全文
摘要:''' Created on 2017年5月23日 @author: weizhen ''' import os import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data # minist_i
阅读全文
摘要:''' Created on May 24, 2017 @author: p0079482 ''' #使用程序输出日志 import tensorflow as tf with tf.Session() as sess: tf.initialize_all_variables().run() for i in range(TRAINING_STEPS): xs,...
阅读全文
摘要:1、还是以手写识别为类,至于为什么一直用手写识别这个例子,原因很简单,因为书上只给出了这个类子呀,哈哈哈,好神奇 下面是可视化学习的标准函数 下面是封装mnist_inference和mnist_train的函数 mnist_train 最后train的结果如下所示 可视化学习的过程,将log写在/
阅读全文
摘要:预测的结果如下所示
阅读全文
摘要:''' Created on 2017年5月13日 @author: weizhen ''' import numpy as np import tensorflow as tf import ptb_iterator as reader from tensorflow.contrib import
阅读全文
摘要:''' Created on Apr 21, 2017 @author: P0079482 ''' #如何通过tf.variable_scope函数来控制tf.ger_variable函数获取已经创建过的变量 #在名字为foo的命名空间内创建名字为v的变量 import tensorflow as tf with tf.variable_scope("foo"): v = tf.get...
阅读全文
摘要:卷积层是神经网络中用于对图像提取特征的结构,有点像高斯滤波去对图像进行平滑处理 不过这里的卷积层要提取的是图像的特征,而且提取图像的算子的值是提前没有确定的 需要通过神经网络的训练来给计算出来
阅读全文
摘要:''' Created on 2017年4月22日 @author: weizhen ''' import os import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import in
阅读全文
摘要:''' Created on Apr 21, 2017 @author: P0079482 ''' #-*- coding:utf-8 -*- import tensorflow as tf #定义神经网络结构相关的参数 INPUT_NODE=784 OUTPUT_NODE=10 LAYER1_NO
阅读全文
摘要:''' Created on Apr 20, 2017 @author: P0079482 ''' import tensorflow as tf #获取一层神经网络边上的权重,并将这个权重的L2正则化损失加入名称为'losses'的集合中 def get_weight(shape,lambda1): #生成一个变量 var = tf.Variable(tf.random_no...
阅读全文
摘要:输出的结果如下所示
阅读全文
摘要:二、OPerator 结果如下所示 三、variables 结果如下所示 四、Feed 五、Interactive 结果如下所示 >>> import testInteractive[-2. -1.]>>> 六、fetch 结果如下所示 >>> import testFetch[21.0, 7.0]
阅读全文
摘要:import testWord2vec2 as tw import tensorflow_util as tu import numpy as np model = tw.load_model() namelist = tw.loadNameList() import jieba namelist1 = [] for name in namelist: seg_list = jieba....
阅读全文
摘要:1、画饼图 确定坐标范围 叠加图 plt.figure() plt.text()添加文字说明
阅读全文