随笔分类 -  Python

摘要:def read_csv(): f = open('train_sales_data.csv') df = pd.read_csv(f) y = np.array(df['UNIT_SALES']) x1 = np.array(df['ITEM_NBR']) x2 = np.array(df['ST 阅读全文
posted @ 2017-12-09 23:30 香港胖仔 阅读(2378) 评论(0) 推荐(0) 编辑
摘要:1、Recursive Nerual Networks能够更好地体现每个词与词之间语法上的联系这里我们选取的损失函数仍然是交叉熵函数 2、整个网络的结构如下图所示: 每个参数的更新时的梯队值如何计算,稍后再给大家计算相应的数学公式 这里先列出节点的合并规则 1、即假设将一句话中的词先两个合并,并通过 阅读全文
posted @ 2017-10-06 22:37 香港胖仔 阅读(508) 评论(0) 推荐(0) 编辑
摘要:今天将的还是cs224d 的problem set2 的第三部分习题, 原来国外大学的系统难度真的如此之大,相比之下还是默默地再天朝继续搬砖吧 下面讲述一下RNN语言建模的数学公式: 给出一串连续的词x1,x2...xt关于预测其后面紧跟的词xt+1的建模方式是: vj是词库中的某个词。实现一个循环 阅读全文
posted @ 2017-09-29 21:34 香港胖仔 阅读(495) 评论(0) 推荐(0) 编辑
摘要:神经网络在命名实体识别中的应用 所有的这些包括之前的两篇都可以通过tensorflow 模型的托管部署到 google cloud 上面,发布成restful接口,从而与任何的ERP,CRM系统集成、 天呀,这就是赤果果的钱呀。好血腥。感觉tensorflow的革命性意义就是能够将学校学到的各种数学 阅读全文
posted @ 2017-09-23 12:08 香港胖仔 阅读(714) 评论(0) 推荐(0) 编辑
摘要:Hi Dear Today we will use tensorflow to implement the softmax regression and linear classifier algorithm. not using the library of tensorflow (like tf 阅读全文
posted @ 2017-09-21 20:42 香港胖仔 阅读(801) 评论(0) 推荐(0) 编辑
摘要:下面是训练的结果 这里边有一个死循环,具体怎么回事我也不太清楚。 下边是可视化训练,展示训练的图像 阅读全文
posted @ 2017-07-23 11:56 香港胖仔 阅读(2537) 评论(0) 推荐(0) 编辑
摘要:''' 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... 阅读全文
posted @ 2017-04-23 10:29 香港胖仔 阅读(7272) 评论(0) 推荐(0) 编辑
摘要:卷积层是神经网络中用于对图像提取特征的结构,有点像高斯滤波去对图像进行平滑处理 不过这里的卷积层要提取的是图像的特征,而且提取图像的算子的值是提前没有确定的 需要通过神经网络的训练来给计算出来 阅读全文
posted @ 2017-04-23 09:46 香港胖仔 阅读(1477) 评论(0) 推荐(0) 编辑
摘要:''' Created on 2017年4月22日 @author: weizhen ''' import os import tensorflow as tf import numpy as np from tensorflow.examples.tutorials.mnist import in 阅读全文
posted @ 2017-04-23 09:41 香港胖仔 阅读(3542) 评论(0) 推荐(0) 编辑
摘要:''' Created on Apr 21, 2017 @author: P0079482 ''' #-*- coding:utf-8 -*- import tensorflow as tf #定义神经网络结构相关的参数 INPUT_NODE=784 OUTPUT_NODE=10 LAYER1_NO 阅读全文
posted @ 2017-04-22 11:06 香港胖仔 阅读(462) 评论(0) 推荐(0) 编辑
摘要:''' Created on Apr 20, 2017 @author: P0079482 ''' import tensorflow as tf #获取一层神经网络边上的权重,并将这个权重的L2正则化损失加入名称为'losses'的集合中 def get_weight(shape,lambda1): #生成一个变量 var = tf.Variable(tf.random_no... 阅读全文
posted @ 2017-04-21 07:57 香港胖仔 阅读(2155) 评论(0) 推荐(0) 编辑
摘要:输出的结果如下所示 阅读全文
posted @ 2017-04-21 07:50 香港胖仔 阅读(1394) 评论(0) 推荐(0) 编辑
摘要:训练的结果如下所示 阅读全文
posted @ 2017-04-21 07:43 香港胖仔 阅读(956) 评论(0) 推荐(0) 编辑
摘要:生成随机数的测试数据 上边的程序运行的结果如下所示: 阅读全文
posted @ 2017-04-08 12:56 香港胖仔 阅读(207) 评论(0) 推荐(0) 编辑
摘要:1、sys包下边的argv方法,从控制台获取数据 就是会判断输入值的大小,并根据控制台输入数组的大小去对字符串进行append 这里要指出,line += digit[row] + " "这一行只是对字符串进行append,所有会用+=并不是对字符串进行连加 阅读全文
posted @ 2017-04-08 11:57 香港胖仔 阅读(256) 评论(0) 推荐(0) 编辑
摘要:训练的结果在附件当中 阅读全文
posted @ 2017-03-04 17:34 香港胖仔 阅读(319) 评论(0) 推荐(0) 编辑
摘要:二、OPerator 结果如下所示 三、variables 结果如下所示 四、Feed 五、Interactive 结果如下所示 >>> import testInteractive[-2. -1.]>>> 六、fetch 结果如下所示 >>> import testFetch[21.0, 7.0] 阅读全文
posted @ 2017-02-01 13:27 香港胖仔 阅读(1249) 评论(0) 推荐(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.... 阅读全文
posted @ 2017-01-19 08:33 香港胖仔 阅读(329) 评论(0) 推荐(0) 编辑
摘要:1、画饼图 确定坐标范围 叠加图 plt.figure() plt.text()添加文字说明 阅读全文
posted @ 2017-01-14 23:28 香港胖仔 阅读(2464) 评论(0) 推荐(0) 编辑
摘要:[[ 0.27559635 0.35930911 0.77030689 0.71818703 0.49122271 0.43190494 0.644674 0.32078174 0.64300877 0.81156862 0.30409896 0.56623858 0.97026539 0.6046 阅读全文
posted @ 2017-01-14 22:47 香港胖仔 阅读(1237) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示