自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 模块的导入与执行

vim test.py # 建立test.py # 在vim剪辑器中编辑以下四行内容 def say_morning(): print('Good morning %s' % __name__) if __name__ == '__main__': say_morning()chmod u+x test.py # 修改test.py为可执行文件当使用python test

2017-07-29 10:55:10 249

原创 other

查看文件夹下文件、子文件夹数目ll|grep '^-'|wc -l # 或 ls -l|grep "^-"|wc -l # 查看当前目录下一般文件数目其中grep '^-'表示只保留一般文件,可用grep '^d'来查看当前目录下子文件夹的数目。 wc -l统计行数,可用ls -l|wc -l查看当前目录下文件和文件夹的数目,即统计ls -l显示出结构的个数。

2017-07-27 11:45:37 197

原创 other_python

vim test.py # 建立test.py # test.py def say_morning(): print('Good morning %s' % __name__) if __name__ == '__main__': say_morning() chmod u+x test.py # 修改test.py为可执行文件当使用python test.py执行的时候

2017-07-27 09:35:25 546

原创 判断文件是否存在

判断文件是否存在os.path.exists(path) # ->True/False # 如果文件夹和文件同名,无法知晓检查的是文件还是文件夹(一般不会出现这种情况,检查文件肯定要带文件扩展名的) os.path.isfile(path) # ->True/False # 只能用于检查文件的path is_exist = pathlib.Path(path) # ->True/F

2017-07-27 09:08:00 312

原创 PIL

ImageOpe模块 From PIL import Image, ImageOps # image_dir = r'D:\data\test.jpg' img = Image.open(image_dir) Autocontrast ImageOps.autocontrast(image, cutoff=0) img_ac = ImageOps.autocontrast(img, c

2017-07-26 14:07:16 215

原创 mysql

locate(substr, str [, pos])返回在pos位置之后,substr在str中出现的位置。若substr在str的pos位置之后没有出现,则返回0。select locate('bing', 'wubinggo') # ->3 select locate('bing', 'wubinggl', 2) # ->3,不是3-2=1 select locate('bing', '

2017-07-23 22:58:11 141

翻译 Foreign Exchange

主要成品及符号 美元=USD(United States Doller) 英镑=GBP(Greate Britain Pound) 欧元=EUR(Europe) 日元=JPY(Japan Yen) 加拿大元=CAD(Canadian Doller) 瑞士法郎=CHF 澳大利亚元=AUD 新西兰元=NZD 外汇交易的参与者 外汇市场是全球最大的金融市场,每天资金流动平均近4兆

2017-07-22 10:55:34 419

原创 Building Graphs

Core graph data structurestf.Graphtf.Graph.get_tensor_by_name(name)根据名称返回tensor。w = tf.get_variable('w', [5,2], initializer=tf.zeors_initializer()) w1 = tf.get_default_graph().get_tensor_by_name('w:0')

2017-07-14 18:00:07 183

原创 math

– – tf.add(x, y) 元素加 tf.subtract(x, y) 元素减 tf.multiple(x, y) 元素乘 tf.scalar_mul(scalar, x) scalar * x tf.div(x, y) 元素(整)除 tf.divide(x, y) 元素(真实)除

2017-07-14 10:41:51 170

原创 tf.others

tf.no_op(name=None)如字面意思“no op”,返回一个什么都不做的tensor。with tf.Session() as sess: a = tf.no_op() tf.global_variables_initializer().run() print(sess.run(a)) # => NoneTensorflow变量初始化函数tf.consta

2017-07-13 17:48:07 275

原创 tf.Graph

tf.Graph.control_dependencies(control_inputs)用在上下文管理器中,参数control_inputs是op或tensor的list,其运行先于上下文管理器中的op或tensor。也可以为None,此时取消了控制依赖关系。with tf.Session() as sess: a = tf.Variable(0) b = tf.Variable(

2017-07-13 17:42:37 455

原创 tf.contrib

tf.contrib.layer1.l2_regularizer(regularization_rate)(weight)对weight施加正则化率为regularization_rate的L2正则化(L1同理)。注意,两个括号之间没有逗号(,)。函数返回一个施加了正则化项的tensor,加入loss中。regularization = tf.contrib.layer2.l2_regularize

2017-07-12 22:06:22 1250

原创 tf.nn

tf.nn.sparse_softmax_cross_entropy_with_logits(logits, labels) 针对硬分类; logits是unscale的,其shape是[batch_size, num_classes],dtype为float32 or float64; labels的shape是[batch_size],dtype为int64,值的含义是所属的类。

2017-07-12 21:53:54 389

原创 tf.trarin

#tf.train.ExponentialMovingAverage(decay, num_updates=None) 1. step = tf.Variable(0, trainable=False) 2. var1 = tf.Variable(0, dtype=tf.float32) 3. var2 = tf.Variable(0, dtype=tf.float32) 4. MOVING_

2017-07-12 18:44:42 329

原创 Variables

a = tf.Variable(...,trainable=False,...)参数trainable=False表示不将变量a加入到tf.GrapsKeys.TRAINABLE_VARIABLES集合中,即变量a不会出现在tf.trainable_variables()函数返回的变量列表中。

2017-07-12 17:58:22 254

空空如也

空空如也

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

TA关注的人

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