python
梦回普达措
C++,C#,机器学习
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
10 python tips and tricks for writing better code
10 python tips and tricks for writing better code1. conditioneg-1condition = Trueif condition: x = 1else: x = 0print (x)a better code for eg-1:condition = Truex = 1 if condition else 0print (x)2. numberseg-2.1num1 = 100000000000原创 2020-06-20 12:20:14 · 402 阅读 · 0 评论 -
用python实现链表反转
class Solution: def reverseList(self,head): if head == None: return None L,M,R = None,None,head while R.next != None: L = M M = R ...原创 2019-07-12 15:44:48 · 487 阅读 · 0 评论 -
异步IO之什么是协程,python yield
请参考这里的最后一段代码:https://www.liaoxuefeng.com/wiki/1016959663602400/1017968846697824也请参考这里的讲解:https://blog.youkuaiyun.com/mieleizhi0522/article/details/82142856补充:协程是在一个线程中运行,由于没有操作系统参与线程的切换,因此效率很高,而且没有多线...原创 2019-05-30 15:31:19 · 331 阅读 · 0 评论 -
tensorflow代码实战5_添加层add_layer_简单例子
说明:资料来源于莫烦老师教程:https://www.youtube.com/watch?v=FTR36h-LKcY&list=PLXO45tsB95cKI5AIlf5TxxFPzb-0zeVZ8&index=15一、代码import tensorflow as tfdef add_layer(inputs,in_size,out_size,activati...原创 2019-05-12 14:25:41 · 371 阅读 · 0 评论 -
关于深度学习中的激励函数的傻瓜式理解
资料来源https://www.youtube.com/watch?v=tI9AbaBfnPc&list=PLXO45tsB95cKI5AIlf5TxxFPzb-0zeVZ8&index=13看了莫烦老师关于激励函数的视频,做个记录:激励函数就是“掰弯函数”,它将线性函数掰弯,使得输出结果有了非线性的特征。激励函数有ReLu,Tanh,sigmoid等,...原创 2019-05-12 13:57:58 · 490 阅读 · 0 评论 -
tensorflow代码实战4_placeholder传入值_简单例子
说明:资料来源于莫烦老师教程:https://www.youtube.com/watch?v=fCWbRboJ4Rs&list=PLXO45tsB95cKI5AIlf5TxxFPzb-0zeVZ8&index=12一、代码import tensorflow as tfinput1 = tf.placeholder(tf.float32)input2 = tf...原创 2019-05-12 13:40:18 · 292 阅读 · 0 评论 -
tensorflow代码实战3_Variable使用_简单例子
说明:资料来源于莫烦老师教程:https://www.youtube.com/watch?v=jGxK7gfglrI&list=PLXO45tsB95cKI5AIlf5TxxFPzb-0zeVZ8&index=11一、代码import tensorflow as tfstate = tf.Variable(0,name='counter')#print...原创 2019-05-12 13:28:13 · 332 阅读 · 0 评论 -
如何用python从网上爬取图片
代码来源于博主“夜雨飘零1”的博客“《PaddlePaddle从入门到炼丹》十一——自定义图像数据集识别”地址:https://blog.youkuaiyun.com/qq_33200967/article/details/87895105亲测可用,图片将会下载到当前用户的根目录下的images中(images文件夹是程序新建的)import reimport uuidimport ...转载 2019-05-06 23:40:37 · 3853 阅读 · 0 评论 -
paddlepaddle学习笔记(4)mnist手写数字识别
一、代码import paddlefrom paddle import fluidimages = fluid.layers.data(name='pixel',shape=[1,28,28],dtype='float32')label = fluid.layers.data(name='label',shape=[1],dtype='int64')conv_pool_1 = ...转载 2019-05-12 13:49:30 · 775 阅读 · 0 评论 -
paddlepaddle学习笔记(3)control flow控制流之while循环
一、代码from paddle import fluida = fluid.layers.fill_constant(shape=[2,2],dtype="float32",value=1.0)i = fluid.layers.zeros([1],dtype="int64")until = fluid.layers.fill_constant([1],dtype="int64",val...转载 2019-05-12 13:50:07 · 480 阅读 · 0 评论 -
paddlepaddle学习笔记(2)control flow控制流之if else判断
一、代码from paddle import fluida = fluid.layers.fill_constant(shape=[2,1],dtype='int64',value=5)b= fluid.layers.fill_constant(shape=[2,1],dtype='int64',value=6)ifcond = fluid.layers.less_than(x=...转载 2019-05-12 13:49:41 · 587 阅读 · 0 评论 -
paddlepaddle学习笔记(1)x+y
一、代码说明layers是一个计算单元,其输入和输出都是variablefetch_list获取输入数据将一个Program()放到Executor中执行运算from paddle import fluidx = fluid.layers.fill_constant(shape=[1],dtype='int64',value=5)y = fluid.layers...转载 2019-05-12 13:49:56 · 487 阅读 · 0 评论 -
如何查看python启动的路径和pip的路径
在终端输入:open ~/.bash_profile查看python调用的路径/usr/local/bin/下可以看到pip,pip2,pip3等的信息,选中一个,右键可以看到其路径,可以帮助分析pip运行的问题...原创 2019-04-29 02:28:34 · 5853 阅读 · 0 评论 -
机器学习常用名词解释
资料来源:百度技术学院视频:http://bit.baidu.com/course/detail/id/137/column/117.html声明:博主只是将资料中的视频整理为图片,在某些地方稍作编辑,为了方便查阅而已。本文绝大部分的智力产出都来源于视频资料。推荐看视频资料以获得更多内容。一、模型?模型,我的理解,就是函数的输入和输出之间的映射关系。如y=θx二、模型的能力?...转载 2019-05-12 13:48:36 · 1284 阅读 · 0 评论 -
tensorflow学习笔记(3) 初识MNIST手写数据集
资料来源:《TensorFlow实战Google深度学习框架》 郑泽宇 梁博文 顾思宇 著 (第二版) 电子工业出版社一、概念 MNIST手写数据集是著名的,入门的样例数据集。这个数据集里边有很多图片,每张图片都代表了0-9这十个数字中的任何一个,且数字都会出现在图片的正中央。每一张图片都是28*28大小的矩阵,这个矩阵中的每个元素的值都是0-1之间的小数,0代表完全的白色...转载 2019-03-17 15:58:59 · 574 阅读 · 0 评论
分享