自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(109)
  • 收藏
  • 关注

转载 笔记神器: Gitee+Typora+Git Bash (全部免费)

笔记神器: Gitee+Typora+Git Bash (全部免费)Gitee(码云)相比于github的优势:免费用户也可以创建私有目录5G存储空间(GitHub貌似推荐存储空间在1G以内)同步速度非常快这种方式令人惊喜的地方:github目录可以直接转移到码云.本地目录可以同时添加GitHub和Gitee远程仓库.Gitee支持给文档打标签typora对markdown和latex的...

2018-07-11 13:21:00 140

转载 np.newaxis为 numpy.ndarray(多维数组)增加一个轴

相当于Nonehttps://blog.csdn.net/lanchunhui/article/details/49725065转载于:https://www.cnblogs.com/HITSZ/p/9216633.html

2018-06-23 11:00:00 88

转载 pycharm远程ssh连接,配置在本地用matplotlib画图

本地电脑是win10系统,用本地的pycharm,ssh连接到服务器。最近需用matplotlib画一些图,于是试着配置了一下。主要需要配置x11 forwarding, Xming,配置ssh支持X11 farwarding开启Xming服务给pycharm配置DISPLAY变量,这一步不知道怎么没配好。最终没实现用pycharm直接画...

2018-06-22 21:36:00 907

转载 python dataframe 空值判断

当在文本文件中,空值为null,读入dataframe中,空值为NaN时,使用pd.isnull()\pd.notnull()对一列进行空值判断;参考:https://blog.csdn.net/xidianliutingting/article/details/62041891转载于:https://www.cnblogs.com/HITSZ/p/9199748.h...

2018-06-19 17:49:00 2033

转载 python中str.format()函数

参考:http://www.runoob.com/python/att-string-format.htmlhttps://www.hackerrank.com/challenges/py-set-mutations/problem?h_r=next-challenge&h_v=zen转载于:https://www.cnblogs.com/HITSZ/p/91984...

2018-06-19 14:41:00 76

转载 ubuntu-shell命令抽取文件一部分行

开头几行:head结尾几行:tail中间几行:sed1. 如果你只想看文件的前100行,可以使用head命令,如head -100 filename2. 如果你想查看文件的后100行,可以使用tail命令,如:tail-100 filename或 tail -n100 filename3. 查看文件中间一段,你可以使用sed命令,如:se...

2018-06-19 10:42:00 188

转载 java中的无符号移位运算

1. 无符号右移 >>> 或>>> =无符号右移(>>>)跟右移(>>)运算符不一样。右移不改变数的正负。对于一个正数,无符号右移不会变成负数(相当于除以1再取整);但是对于一个负数,无符号右移会将负数变成正数; int i = -4; System.out.printf("%-10d %...

2018-06-14 08:37:00 87

转载 python中的*args 和**kwargs

*args是可变长参数,在函数内部以tuple形式存储;def fun_var_args(farg, *args): print "arg:", farg print(type(args))>>> fun_var_args(1, 'two', 3)arg: 1<type 'tuple'>def fun_var...

2018-06-12 14:42:00 46

转载 collections中的Counter、defaultdict和OrderedDict

Counter可以用来统计list中有哪些元素,每个出现多少次;defaultdict中指定value的类型后,比如指定为int,则对于没有出现过的key,其value为0,而不是报错;(value类型还能指定为list,则没出现过的key,其value为[]);OrderedDict中可以进行排序;转载于:https://www.cnblogs.com/HITSZ/p/91...

2018-06-12 14:27:00 66

转载 alias命令切换python版本

https://github.com/eagleon/eagleon.github.com/issues/2转载于:https://www.cnblogs.com/HITSZ/p/9169252.html

2018-06-11 21:08:00 873

转载 python拆分整型字符串并转为整型list

python正则表达式模块,拆分字符串,re.split()eg:s = '1, 2, 3, 4'拆分组成数字list:strs = re.split(', ', s);print(strs);结果:['1', '2', '3', '4']转成int行list:strs = list(map(int, strs));print(strs);...

2018-05-18 19:24:00 119

转载 Python格式化字符 %s %d %f

格式 描述%% 百分号标记 #就是输出一个%%c 字符及其ASCII码%s 字符串%d 有符号整数(十进制)%u 无符号整数(十进制)%o 无符号整数(八进制)%x 无符号整数(十六进制)%X 无符号整数(十六进制大写字符)%e 浮点数字(科学计数法)%E 浮点数字(科学计数法,用E代替e)%f 浮点数字(用小数点符号)%g 浮点数字(根据值的大小采用%e或%f)%G 浮点数字(类似于%...

2018-05-18 19:23:00 58

转载 python稀疏矩阵sparse matrix的保存和读取

from scipy import sparsesparse.save_npz('./filename.npz', csr_matrix_variable) #保存csr_matrix_variable = sparse.load_npz('path.npz') #读参考:https://blog.csdn.net/weixin_36218261/artic...

2018-05-18 19:22:00 613

转载 两台Ubuntu之间互传文件-scp命令

https://blog.csdn.net/gatieme/article/details/51673229scp remote_user_name@remote_ip:remote_file_path local_path转载于:https://www.cnblogs.com/HITSZ/p/9057590.html

2018-05-18 19:22:00 269

转载 用pickle保存python程序中间变量

用pickle保存中间变量:with open('path/file_name.pickle', 'wb') as handle: pickle.dump(variable_name, handle, protocol=2)用pickle读取中间变量:with open('path/file_name.pickle', 'rb') as handle: var...

2018-05-18 19:21:00 196

转载 设置jupyter中,dataframe每一行的最大输出列数

https://stackoverflow.com/questions/11707586/python-pandas-how-to-widen-output-display-to-see-more-columnsimport pandas as pdpd.set_option('display.height', 1000)pd.set_option('display.max_...

2018-04-18 21:01:00 353

转载 python大文件统计有多少行

num_col = 0;with open('xxx/xxx.xxx','rb') as fi:  while(fi.readline() !=''):    num_col = num_col + 1;转载于:https://www.cnblogs.com/HITSZ/p/8875045.html

2018-04-18 15:17:00 321

转载 ubuntu安装xgboost,安装之后jupyter notebook不能导入xgboost的解决方法

https://blog.csdn.net/pipixiu/article/details/78628823转载于:https://www.cnblogs.com/HITSZ/p/8832847.html

2018-04-14 16:56:00 322

转载 seaborn画协方差矩阵

https://blog.csdn.net/a19990412/article/details/79304944求DataFrame的协方差矩阵df.corr()import seaborn as snsplt.subplots(figsize=(3,3))sns.heatmap(df_cov, annot=True, vmax=1, square=True, c...

2018-04-14 03:16:00 378

转载 线性可分支持向量机与软间隔最大化

转载于:https://www.cnblogs.com/HITSZ/p/8810461.html

2018-04-12 21:10:00 74

转载 线性可分支持向量机与硬间隔最大化

转载于:https://www.cnblogs.com/HITSZ/p/8762929.html

2018-04-09 20:58:00 51

转载 拉格朗日对偶问题

转载于:https://www.cnblogs.com/HITSZ/p/8735225.html

2018-04-07 22:16:00 54

转载 检验某个变量是否服从正太分布

检验同一个热点,同一个采样点,同一个channel的csi值(500个)是否符合正太分布,或者符合其他什么分布?采用Q-Q图。参考资料:https://wenku.baidu.com/view/c661ebb365ce050876321319.html用QQ图检验一序列是否服从正太分布,序列为X=(x1,x2,…,xi,…xN),(N>0)将原序列按从小到大的顺...

2018-04-07 14:46:00 540

转载 对较大的原始csv文件抽取出一部分样本

避免对大文件全部读取到内存中,浪费时间,也能避免内存溢出;先对文件先进行抽样,抽出很小一部分,测试程序的语法正确性,再用全部文件测试程序的功能正确性;import tensorflow as tfimport numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport csv# 原始c...

2018-04-05 14:56:00 290

转载 tensorflow的1维卷积

前面找到了tensorflow的一维卷积、池化函数,但是官方API太简单,网上的例子也不多。由于没时间研究源码,只能另寻他法了。后面细细想来,tensorflow的二维卷积、池化函数,好像也能进行一维卷积、池化;也就是,利用对图像矩阵进行卷积、池化的函数,把第一个维度设置成1。这样做确实可行,最简单的代码示例如下:import tensorflow as tfim...

2018-04-05 10:40:00 166

转载 tensorflow实现1维池化操作

参考:https://github.com/tensorflow/tensorflow/issues/9442https://www.tensorflow.org/versions/r1.5/api_docs/python/tf/layers/MaxPooling1D转载于:https://www.cnblogs.com/HITSZ/p/8711658.html...

2018-04-03 22:50:00 256

转载 java中的Queue

Queue是java的一个借口,实现了Collection,LinkedList是实现了Queue的数据结构;关于使用LinkedList的操作见:https://blog.csdn.net/sinat_36246371/article/details/53709625转载于:https://www.cnblogs.com/HITSZ/p/8711331.html...

2018-04-03 21:44:00 34

转载 tensorflow实现1维卷积

官方参考文档:https://www.tensorflow.org/api_docs/python/tf/nn/conv1d参考网页:http://www.riptutorial.com/tensorflow/example/19385/basic-examplehttp://www.riptutorial.com/tensorflow/example/30750/math-...

2018-04-03 20:31:00 148

转载 python3和Python2的差别

print在python2中是关键字,在Python3中是函数dict在python2中有has_key()方法,在python3中没有这个方法,用key in dict_name判断键是否在字典中转载于:https://www.cnblogs.com/HITSZ/p/8696710.html...

2018-04-02 20:00:00 45

转载 tensorflow实现L2正则化

https://www.jianshu.com/p/db8ca931026aimport tensorflow as tfimport numpy as npdef get_weights(shape, lambd): var = tf.Variable(tf.random_normal(shape), dtype=tf.float32) ...

2018-04-02 16:07:00 212

转载 林轩田--支持向量机笔记(1)

转载于:https://www.cnblogs.com/HITSZ/p/8689154.html

2018-04-01 23:42:00 43

转载 python读csv文件中文汉字出现UnicodeDecodeError

出错代码:data = pd.read_csv(fname);原因:byte 0xcb不能被解码成utf-8编码;解决方法:指定使用gbk编码  data = pd.read_csv(fname, encoding='gbk');转载于:https://www.cnblogs.com/HITSZ/p/8688616.html...

2018-04-01 22:05:00 559

转载 jupyter notebook 不能画图

要加一句 %matplotlib inline转载于:https://www.cnblogs.com/HITSZ/p/8682146.html

2018-03-31 14:43:00 216

转载 tensorflow中reduce_xxx函数

tf.reduce_mean() https://www.douban.com/note/636187116/reduce_sum(), reduce_max()等等类似,只要记住第二个参数:如果没有指定,则是将数据结构视为1维;如果是0,则是在第1维,各个对应位置进行计算;如果是1,则是在第2维.转载于:https://www.cnblogs.com/HITSZ...

2018-03-31 14:38:00 78

转载 tensorflow中用正太分布随机初始化网络权重参数 ---tf.random_normal

https://www.tensorflow.org/api_docs/python/tf/random_normalnumpy的random库也有normal函数,功能类似,参数排列次序不同:https://docs.scipy.org/doc/numpy-1.13.0/reference/generated/numpy.random.normal.html转载于:http...

2018-03-31 10:05:00 210

转载 将dataframe变量转为tf.constant变量

https://www.tensorflow.org/api_docs/python/tf/constant转载于:https://www.cnblogs.com/HITSZ/p/8679238.html

2018-03-30 23:15:00 108

转载 dataframe to tensor

https://stackoverflow.com/questions/42286972/converting-from-pandas-dataframe-to-tensorflow-tensor-object转载于:https://www.cnblogs.com/HITSZ/p/8679206.html

2018-03-30 23:04:00 922

转载 Python-Pandas 如何shuffle(打乱)数据?

https://blog.csdn.net/qq_22238533/article/details/70917102转载于:https://www.cnblogs.com/HITSZ/p/8679188.html

2018-03-30 23:01:00 93

转载 TensorFlow实战(1)

神经网络的变量声明函数:tf.Variable()初始化所有变量:  sess = tf.Session()  init_op = tf.global_variables_initializer()  sess.run(init_op)对于交叉熵的理解:交叉熵是两个概率分布之间的距离。eg:  假如有个三分类问题,某个样例的正确答案是(1,0,0)。某模型经过soft...

2018-03-27 14:00:00 82

转载 基本概念——张量、会话、计算图

张量:tensor,张量可以被简单理解为多维数组,张量在tensorflow中的实现并不是直接采用数组的形式,它只是对TensorFlow中运算结果的引用。在张量中并没有真正保存数字,它保存的是如何得到这些数字的计算过程。张量的三要素:名字、维度、类型。eg:  会话:会话拥有并管理TensorFlow程序运行时的所有资源。  两种会话模式,第一种模式需要明确调用会话生成...

2018-03-26 19:47:00 64

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除