- 博客(21)
- 资源 (1)
- 收藏
- 关注
原创 random模块
random模块是一个很有用的模块,在随机选取样品的时候有用,或者打乱样品的时候有用.import randoma = [1,2,3,4,5,6]random.shuffel(a) # 洗牌,打乱原来的样品a[2,1,5,4,6,3]random.ranint(random.random random.random()用于生成一个0到1的随机符点数: 0 <= ...
2018-05-24 00:27:28 322
原创 列表推导式[x for x in range(n)]
1.匿名函数匿名函数语法形式: lambda [arg1,arg2,arg3,argn]:expression 注解: lambda 关键字 argi 函数参数 expression 程序逻辑,即函数要返回值的表达式 该表达式不能包含其他语句,可以返回带括号的(元组),同时允许在表达式中调用其它函数。&gt;&gt;&gt; c = lambda x,y:x * x + y...
2018-05-24 00:10:53 42912 8
原创 python.zip()函数
Definition : zip(iter1 [,iter2 [...]])Type : Function of builtins modulezip(iter1 [,iter2 […]]) –> zip objectReturn a zip object whose .next() method returns a tuple where the i-th element ...
2018-05-23 20:46:06 295
转载 tf.control_dependencies()作用及用法
参考的博客:https://blog.csdn.net/PKU_Jade/article/details/73498753 在facenet .py的line 75-77 有引用该函数。with tf.control_dependencies([centers]): # 操作依赖,loss内的操作,将会再centers后再进行。 loss = tf.reduce_mean(t...
2018-05-23 17:14:02 1471
转载 tf.grather()
import tensorflow as tftemp = tf.range(0,10)*10 + tf.constant(1,shape=[10])temp2 = tf.gather(temp,[1,5,9])with tf.Session() as sess: print sess.run(temp) print sess.run(temp2)输出 [ 1...
2018-05-21 22:01:11 1278
原创 tf.scatter_sub(ref, indices, updates)and tf.scatter_update(ref, indices, updates, use_locking = None
类似的 sub函数!ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8],dtype = tf.int32)indices = tf.constant([4, 3, 1, 7],dtype = tf.int32)updates = tf.constant([9, 10, 11, 12],dtype = tf.int32)sub = tf.scatt...
2018-05-21 21:59:04 745
转载 tf.reshpe(a,[-1])_注意参数的-1的特殊
# tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]# tensor 't' has shape [9]reshape(t, [3, 3]) ==> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]# tensor 't' is [[[1...
2018-05-21 21:20:39 396
转载 tf.maximun(a,b)_tf.minimum(a,b)
tf.maximum:用法tf.maximum(a,b),返回的是a,b之间的最大值,tf.miniimum:用法tf.miiinimum(a,b),返回的是a,b之间的最小值,tf.argmax:用法tf.argmax(a,dimension),返回的是a中的某个维度最大值的索引,tf.argmain:用法tf.argmin(a,dimension),返回的是a中的某个维度最小值的索...
2018-05-21 21:05:23 10473
转载 scipy的ndimage模块中有关数学形态学_膨胀腐蚀开操作_闭操作
square = np.zeros((32,32))square[10:20, 10:20] = 1x,y =(32*np.random.random((2,15))).astype(np.int) # 指的是维数,,15是每个数组里面元素的个数,数组的范围是0-1.并且把数值的类型设置为整数square[x, y ] = 1 #把相应位置的元素,设置为1x,y = (32 * np....
2018-05-21 20:40:14 2077
原创 scipy模块_misc模块,imread,imresize, imsave / imshow/ imrotate
#导入scipy模块下的图像处理函数from scipy.misc import imread / imsave / imshow #读取图像,保存,显示imresize / imrotate / imfilter #改变图像的大小,翻转图像,过滤1.scipy.misc 下的图像处理from scipy.misc import imread, imresize, imsa...
2018-05-21 19:37:10 2682
原创 six_module—兼容python2与3的模块
· Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is com...
2018-05-20 19:01:47 461
转载 tensorflow—读取图片_gfile
在初涉tensorflow的时候,一般采用公开数据集进行训练,对于数据集的格式以及读取很不清楚,所以这里给出tensorflow直接读取图像序列的方法,自己进行数据集的构建。下面给出集中可以参考的方法。 一、单张图片读取 1.tensorflow的gfile读取图像,matplotlib用于可视化 使用tensorflow里面给出了一个函数用来读取图像,tf.gfile.FastGFi...
2018-05-20 18:12:21 889
原创 k_flods,k折交叉验证法
python使用k折交叉验证的代码 K折交叉验证:sklearn.model_selection.KFold(n_splits=3, shuffle=False, random_state=None)思路:将训练/测试数据集划分n_splits个互斥子集,每次用其中一个子集当作验证集,剩下的n_splits-1个作为训练集,进行n_splits次训练和测试,得到n_splits个结果注意...
2018-05-20 17:36:07 1928
原创 argparse 模块_解析命令行模块
主要的功能是可以让程序使用命令行命令。 专门用来解析命令行 文件名称argparse_test.pyimport argparseparser = argparse.ArgumentParser()parser.add_argument("echo")args = parser.parse_args()print(args.echo)输出:>>>p...
2018-05-20 15:35:24 185
转载 图像分割预处理
一 全卷积神经网络文章所有代码已上传至github,觉得好用就给个star吧,谢谢https://github.com/315386775/FCN_train深度学习图像分割(FCN)训练自己的模型大致可以以下三步:1.为自己的数据制作label;2.将自己的数据分为train,val和test集;3.仿照voc_lyaers.py编写自己的输入数据层。其中主要是如何制...
2018-05-19 21:56:08 4164
转载 网络模型中Inception的作用与结构全解析
一 论文下载 本文涉及到的网络模型的相关论文以及下载地址: [v1] Going Deeper with Convolutions, 6.67% test error http://arxiv.org/abs/1409.4842 [v2] Batch Normalization: Accelerating Deep Network Training by Reducin...
2018-05-19 21:34:05 1076
转载 ResNet论文(深度残差网络)
ResNet——MSRA何凯明团队的Residual Networks,2015年,在ImageNet的classification、detection、localization以及COCO的detection和segmentation上均斩获了第一名的成绩,而且Deep Residual Learning for Image Recognition也获得了CVPR2016的best paper。...
2018-05-19 20:55:45 7112 2
转载 matlab_移动文件和复制文件
clear clc cd('C:\Documents and Settings\Administrator\桌面\matlab\test'); % 设置当前目录 % 此时test文件夹中有:文件夹1, 文件夹2, 文件1.txt, 文件2.txt movefile('1.txt', '11.txt'); % 把1.txt剪切成11.txt(1.txt不存在了),实际上相当于...
2018-05-18 10:24:34 20289
转载 如何删除僵尸进程
转载~~今天在维护服务器的时候,发现有5个nova-novncproxy的僵尸进程。26327 ? S 0:05 _ /usr/bin/python /usr/bin/nova-novncproxy –config-file=/etc/nova/nova.conf 4765 ? Z 0:00 _ [nova-novncprox...
2018-05-17 12:24:34 974
转载 ORL人脸数据集
The Database of FacesOur Database of Faces, (formerly ‘The ORL Database of Faces’), contains a set of face images taken between April 1992 and April 1994 at the lab. The database was used in the con...
2018-05-12 21:08:34 11990
转载 PGM便携式灰度图像格式
NET framework框架类库中的Image类和Bitmap类提供了常用图像格式的解析读取和存储,这些常用格式包括BMP,JEPG,GIF,PNG,EXIF,TIFF.但是可惜的是不支持PGM格式,但是只要知道了PGM格式的文件的组织结构,相信要解析他也不是难事了.1.PGM图像详解PGM 是便携式灰度图像格式(portable graymap file format),在黑白超声图像...
2018-05-12 21:04:04 1851
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人