求300MIUM-128qq推销学习资料违法吗,求好心人,349120536@qq.com

求星际争霸人族坦克变形+架起后开炮的声音 要高128kbps 以上的 谢谢了 MP3格式的!邮箱:_百度知道
求星际争霸人族坦克变形+架起后开炮的声音 要高128kbps 以上的 谢谢了 MP3格式的!邮箱:
我有更好的答案
ttatra01只有wav格式的,352kbps
为您推荐:
其他类似问题
星际争霸人族的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。求淘宝店铺装修免费模板,与开店经验,望热心人帮助,可以发到我邮箱,非常感谢_百度知道
求淘宝店铺装修免费模板,与开店经验,望热心人帮助,可以发到我邮箱,非常感谢
我是淘宝新手,有哪位好心人能不能教点经验给我啊,万分感谢
我有更好的答案
新手淘宝送创业板,是免费的,你进店铺装修,选择模板,可以在里面领取,上钻以后就要收钱了。
可以上网搜阿
我也是新手,装修都是自己弄得,没花钱,我的店铺是
彼岸花开也可以Q我
为您推荐:
其他类似问题
淘宝店铺装修的相关知识
换一换
回答问题,赢新手礼包
个人、企业类
违法有害信息,请在下方选择后提交
色情、暴力
我们会通过消息、邮箱等方式尽快将举报结果通知您。&p&在我看来做数学没有必读书。大成至圣先师G子不是曰过吗?我们不读书,我们写书!那些老学究、老傻子们总是跟你说,这个必读啊,那个必读啊,实际上也不知道他们读懂了几本。要是真读懂了,还能这么弱吗?下面罗列一些我感兴趣的书,但其中大多数我都没读过/没读完,什么时候一起来读一读吧,相信一定会有收获的。有人可能说这些不是入门书啊, 但门有很多,入了一道还有另一道。做数学,本身就是以有涯随无涯。且和做研究相比,这些知识就是入门级别的。这些书虽然不都是通常意义下的几何类书籍,但我敢保证它们和各种几何的关系非常密切。由于我的兴趣爱好偏向辛几何,所以这些书和辛几何的相关性可能会更高。若能读懂其中几本,今后一定会有用的。&i&初学者尤其不能以所谓的方向来禁锢自己。&/i&你们可以自己上豆瓣看看,啃老民科Strongart读过多少数学书。若你阅读的数学文献还不如一个啃老民科多,还有脸说自己是做数学的吗?&/p&&p&&b&1.Gromov: Partial differential relations&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-548fb377c503a2e88fbb01ab5049125a_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&297& data-rawheight=&447& class=&content_image& width=&297&&&/figure&&p&&b&2.Seidel: Fukaya categories and Picard Lefschetz theory&/b&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-5e2c965c7c8b3a0c14bca97_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&438& data-rawheight=&619& class=&origin_image zh-lightbox-thumb& width=&438& data-original=&https://pic4.zhimg.com/v2-5e2c965c7c8b3a0c14bca97_r.jpg&&&/figure&&p&&b&3.Positselski: Homological Algebra of Semimodules and Semicontramodules&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-cf21e858b6ea_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&198& data-rawheight=&300& class=&content_image& width=&198&&&/figure&&p&&b&4.Kirillov: Quiver Representations and Quiver Varieties&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-ee3b84935f2baf46537f4_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&332& data-rawheight=&499& class=&content_image& width=&332&&&/figure&&p&&b&4.Simpson: Asymptotic Behavior of Monodromy&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-a0df1d3a5839bbfe89f9b9817043bfa6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&264& data-rawheight=&400& class=&content_image& width=&264&&&/figure&&p&&b&5. Girondo-González-Diez: Introduction to Compact Riemann Surfaces and Dessins D'Enfants&/b&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-98c69f41aa24fa0a1f364b3def2a38df_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&294& data-rawheight=&450& class=&content_image& width=&294&&&/figure&&p&&b&6. Khalkhali: Basic Noncommutative Geometry&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-efa06c9ef860d52eeb86f3ee0dfba856_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&306& data-rawheight=&435& class=&content_image& width=&306&&&/figure&&p&&b&7.Riehl: Categorical Homotopy Theory&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-4dc2d3fa39cabbd97df7c4_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&288& data-rawheight=&462& class=&content_image& width=&288&&&/figure&&p&&b&8.Van den Bergh: Blowing up non-commutative smooth surfaces&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-bdbdbc873e3b125ce8242_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&343& data-rawheight=&490& class=&content_image& width=&343&&&/figure&&p&&b&9.Positselski: Two Kinds of Derived Categories, Koszul Duality, and Comodule-Contramodule Correspondence&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-057f3f9b901df364d0e99_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&343& data-rawheight=&490& class=&content_image& width=&343&&&/figure&&p&&b&10.Wall: Surgery on Compact Manifolds&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-05d1024edaaa8ebe48d7ce_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&294& data-rawheight=&453& class=&content_image& width=&294&&&/figure&&p&&b&11. Kiehl-Weissauer: Weil Conjectures, Perverse Sheaves and l'adic Fourier Transform&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-5e5e9ef5d7bc02b67d1e_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&267& data-rawheight=&400& class=&content_image& width=&267&&&/figure&&p&&b&12.Simpson: Homotopy Theory of Higher Categories&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-1ac17691e25dcd8f4b6ee3e_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&297& data-rawheight=&447& class=&content_image& width=&297&&&/figure&&p&&b&13. Abbas: An Introduction to Compactness Results in Symplectic Field Theory&/b&&/p&&figure&&img src=&https://pic3.zhimg.com/v2-3d02d835df91aeebb1d6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&231& data-rawheight=&346& class=&content_image& width=&231&&&/figure&&p&&b&14. Quillen: Homotopical Algebra&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-4bfaed6ce190aa851b13194_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&294& data-rawheight=&450& class=&content_image& width=&294&&&/figure&&p&&b&15.Humphreys: Representations of Semisimple Lie Algebras in the BGG Category &/b&&img src=&//www.zhihu.com/equation?tex=%5Cmathcal%7BO%7D& alt=&\mathcal{O}& eeimg=&1&&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-b35a24dfce77fc6eea393dcefa7ca83f_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&294& data-rawheight=&450& class=&content_image& width=&294&&&/figure&&p&&b&16: Vojta: Diophantine Approximations and Value Distribution Theory&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-950f85baf7dac29ff7f89ed3e1130448_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&297& data-rawheight=&447& class=&content_image& width=&297&&&/figure&&p&&b&17. Loday-Vallette: Algebraic Operads&/b&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-25b59ae0cb34f0d342d5ec_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&281& data-rawheight=&420& class=&content_image& width=&281&&&/figure&&p&&b&18. Cieliebak-Eliashberg: From Stein to Weinstein and back&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-17b031812becb8fd277ac82f65439d51_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&330& data-rawheight=&499& class=&content_image& width=&330&&&/figure&&p&&b&19. Nakajima: Lectures on Hilbert Schemes of Points on Surfaces&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-c8b0def8065ab73bcf549_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&343& data-rawheight=&490& class=&content_image& width=&343&&&/figure&
在我看来做数学没有必读书。大成至圣先师G子不是曰过吗?我们不读书,我们写书!那些老学究、老傻子们总是跟你说,这个必读啊,那个必读啊,实际上也不知道他们读懂了几本。要是真读懂了,还能这么弱吗?下面罗列一些我感兴趣的书,但其中大多数我都没读过/…
首先我觉得你应该好好过一遍MIT的Linear Algebra的课。这个课有两个版本,我是跟这个更适合自学的版本。因为这个版本所有章节都模块化了,跟起来不会让人觉得压力很大。&a href=&//link.zhihu.com/?target=https%3A//ocw.mit.edu/courses/mathematics/18-06sc-linear-algebra-fall-2011/index.htm& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Linear Algebra&/a&&br&&br&我所说的过一遍,不是你看个录像就完事儿了的,首先,把pdf资料都打印出来,然后你得记笔记,接着你得跟着助教做习题课的练习,最后你得把课后作业都做完,并且把考试也做完(都有答案的你自己可以check)。这个版本的题目量不是很大,但是都是精挑细选的题目,做完会让你有一种豁然开朗的感觉。不管你本科是不是理工科,线代基础有多好,我都建议仔细过一遍,一定能发现很多新东西。如果基础够好,用不着看课本,直接看讲义就行了,因为已经讲得很细很好了。&br&&br&然后就是前面说的Matrix Cookbook,&br&&a href=&//link.zhihu.com/?target=https%3A//www.ics.uci.edu/%7Ewelling/teaching/KernelsICS273B/MatrixCookBook.pdf& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&https://www.&/span&&span class=&visible&&ics.uci.edu/~welling/te&/span&&span class=&invisible&&aching/KernelsICS273B/MatrixCookBook.pdf&/span&&span class=&ellipsis&&&/span&&/a&&br&这本书其实就是一本速查手册,里面向量矩阵微分的东西还是很全的。这些东西一般也很难背下来,用到了查就是了。&br&&br&如果你要从写code的层面去学线性代数,方法一,就是看这本书:&br&Coding the Matrix: Linear Algebra through Applications to Computer Science&br&&a href=&//link.zhihu.com/?target=https%3A//www.amazon.com/Coding-Matrix-Algebra-Applications-Computer/dp//ref%3Dsr_1_8%3Fie%3DUTF8%26qid%3D%26sr%3D8-8%26keywords%3Dlinear%2Balgebra& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Linear Algebra through Applications to Computer Science: Philip N. Klein: 0: Amazon.com: Books&/a&&br&布朗大学之前在coursera开过公开课,好像已经下架了,不过网上能找到视频。&br&&br&如果你要从写code的层面去学线性代数,但是你想上一门课,方法二,就是去跟EDX这门课:&br&&a href=&//link.zhihu.com/?target=https%3A//www.edx.org/course/linear-algebra-foundations-frontiers-utaustinx-ut-5-04x& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Linear Algebra - Foundations to Frontiers&/a&&br&&br&如果你要是对矩阵的数值计算计算感兴趣那就去看约翰霍普金斯大学的&br&Matrix Computations &a href=&//link.zhihu.com/?target=https%3A//www.amazon.com/Computations-Hopkins-Studies-Mathematical-Sciences/dp//ref%3Dsr_1_1%3Fie%3DUTF8%26qid%3D%26sr%3D8-1%26keywords%3DMatrix%2Bcomputation& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Gene H. Golub, Charles F. Van Loan: 4: Amazon.com: Books&/a&,&br&不过现在Matlab和Numpy的线性代数的库已经很厉害了,所以自己手动去实现矩阵计算的机会我个人认为应该不会特别多。&br&&br&其他的话,ML的书中和论文中出现什么上网搜就行了。&br&&br&最后墙裂建议先把MIT的认真上一遍,真的是上过的最好的一门线性代数打底的课程:&br&&br&----------------------------------&br&-------------------------Update 一下-------------&br&国内要是有看不到的可能因为视频是youtube的,看网易公开课对应章节的课程视频和习题课视频就行了:&br&&br&课程视频:&br&&a href=&//link.zhihu.com/?target=http%3A//open.163.com/special/opencourse/daishu.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&麻省理工公开课:线性代数_全35集_网易公开课&/a&&br&&br&习题课视频:&br&&a href=&//link.zhihu.com/?target=http%3A//open.163.com/special/opencourse/mitxianxingdaishuxitike.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&麻省理工学院公开课:MIT线性代数习题课_全36集_网易公开课&/a&&br&-----------------------&br&布朗大学的那个Coding the Matrix的视频,在这里:&br&&a href=&//link.zhihu.com/?target=https%3A//cs.brown.edu/video/channels/coding-matrix-fall-2014/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Coding the Matrix, Fall 2014&/a&&br&整本书的资料,在这里:&br&&a href=&//link.zhihu.com/?target=http%3A//codingthematrix.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Coding The Matrix&/a&&br&&br&&br&&figure&&img src=&https://pic1.zhimg.com/v2-eb0f42dbccc_b.jpg& data-rawwidth=&2016& data-rawheight=&1512& class=&origin_image zh-lightbox-thumb& width=&2016& data-original=&https://pic1.zhimg.com/v2-eb0f42dbccc_r.jpg&&&/figure&
首先我觉得你应该好好过一遍MIT的Linear Algebra的课。这个课有两个版本,我是跟这个更适合自学的版本。因为这个版本所有章节都模块化了,跟起来不会让人觉得压力很大。 我所说的过一遍,不是你看个录像就完事儿了的,首先,把pdf资料都打印…
&figure&&img src=&https://pic4.zhimg.com/v2-9c8c34f8a46a7e58ca907e80bc2bf59f_b.jpg& data-rawwidth=&766& data-rawheight=&502& class=&origin_image zh-lightbox-thumb& width=&766& data-original=&https://pic4.zhimg.com/v2-9c8c34f8a46a7e58ca907e80bc2bf59f_r.jpg&&&/figure&&p&这是菜鸟学Python的第119篇原创文章&/p&&p&阅读本文大概需要3分钟 &/p&&p&前面我写过一篇文章谈了自己的Python学习经验(&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Db9dea820e4c9eae757b9c5%26chksm%3D97889fdda0ff16cb8e140c9c06bdb29aa4e65638f2ced1e28a63de45de0a9cdfe63%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&我学Python的经验&/a&&/u&),里面谈到&技巧宛如一颗一颗珍珠&,后台有好几个小伙伴留言,能不能分享一些技巧. 其实我的公众号里面多多少少分享过一些,今天我分享一些自己私藏的非常不错的技巧和代码给大家,希望对大家有用!&/p&&p&&br&&/p&&p&&b&1.一行代码,巧妙求解&/b&&/p&&p&列出1到20的数字,若是3的倍数就用apple代替,若是5的倍数就用orange代替,若既是3的倍数又是5的倍数就用appleorange代替&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&print ['apple'[i%3*5::]+'orange'[i%5*6::] or i for i in range(1,21)]
&/code&&/pre&&/div&&p&&i&点评:字符串的处理我自认为掌握的非常熟练了,各种奇淫技巧都已经烂熟于心,但是当我看到上面这个解法的时候,彻底跪了太巧妙了.&/i&&/p&&p&&br&&/p&&p&&b&2.推导列表生成字典&/b&&/p&&p&推导列表我相信大家都用过,但是推导列表还能生成字典,非常简洁.&/p&&figure&&img src=&https://pic2.zhimg.com/v2-7ba8bd7a54fdaf8afd7a9200ccec01bf_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&910& data-rawheight=&204& class=&origin_image zh-lightbox-thumb& width=&910& data-original=&https://pic2.zhimg.com/v2-7ba8bd7a54fdaf8afd7a9200ccec01bf_r.jpg&&&/figure&&p&&i&点评:字典的生成相信每个人都会,但是用推导列表生成字典并不是时刻都会想到的.&/i&&/p&&p&&b&3.漂亮的zip生成&/b&&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&print dict(zip('abcd',range(4)))
&&{'a': 0, 'c': 2, 'b': 1, 'd': 3}
&/code&&/pre&&/div&&figure&&img src=&https://pic3.zhimg.com/v2-1fd8aaf6e98b_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&820& data-rawheight=&336& class=&origin_image zh-lightbox-thumb& width=&820& data-original=&https://pic3.zhimg.com/v2-1fd8aaf6e98b_r.jpg&&&/figure&&p&&i&点评:zip是一个非常重要的函数,非常方便.熟悉掌握zip帮我大幅的减少函数的代码和复杂度,并且提高效率,zip是我最喜欢的函数之一!&/i&&/p&&p&&br&&/p&&p&&b&4.if val is not None &/b&&/p&&p&为啥会这样写呢,为啥不能写成 if val ,不知道大家有没有思考过这样问题.&/p&&p&其实这两者是有区别的:比如val 可能为'',0,None,[],{} &/p&&p&如果写成if val 会把'',0,[],{}这样的情况也包含在里面,有的时候我们其实只想过滤掉不为None的情况&/p&&p&&i&点评:平时学会推敲很重要,为啥有的代码要这样写,有的要那样写,比如==和is的区别。&/i&&/p&&p&&br&&/p&&p&&b&5.list分组&/b&&/p&&p&有的时候我们希望对一个list进行分组,有什么好的办法呢&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&a=[3, 8, 9, 4, 1, 10, 6, 7, 2]
print [a[i:i+3] for i in xrange(0,len(a),3)]
&&[[3, 8, 9], [4, 1, 10], [6, 7, 2]]
&/code&&/pre&&/div&&p&&i&点评:通过一个推导列表和切片的完美组合,就可以轻松化解.&/i&&/p&&p&&br&&/p&&p&&b&6.递归的好例子&/b&&/p&&p&比如有一个嵌套的列表,里面嵌套了很多层,有列表有元组,层层嵌套,如何把它转换成只有一层的列表,必须要用递归也能解决&/p&&figure&&img src=&https://pic3.zhimg.com/v2-8ffb60c4ecb96b6a2c6dcf9d359f875a_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1016& data-rawheight=&462& class=&origin_image zh-lightbox-thumb& width=&1016& data-original=&https://pic3.zhimg.com/v2-8ffb60c4ecb96b6a2c6dcf9d359f875a_r.jpg&&&/figure&&p&&i&点评:递归觉得是一个好东西,虽然理解起来很复杂,但是可以用很少的代码解决很多复杂的问题.&/i&&/p&&p&&br&&/p&&p&&b&7.查询列表里面的某一个值&/b&&/p&&p&有的时候,我们需要从比如一个很长的列表里面,找到某一个或者某一类的元素,怎么办? 很简单用高级函数filter()&/p&&figure&&img src=&https://pic1.zhimg.com/v2-e9158abac796bfadbdefbb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1028& data-rawheight=&336& class=&origin_image zh-lightbox-thumb& width=&1028& data-original=&https://pic1.zhimg.com/v2-e9158abac796bfadbdefbb_r.jpg&&&/figure&&p&&i&点评:Python里的高阶函数一直是我的最爱,像map,zip,filter应该要熟练掌握.&/i&&/p&&p&&br&&/p&&p&&b&8.一个不错的namedtuple class&/b&&/p&&p&namedtuple是collections模块里面的一个非常有用的函数,类似一个小的迷你类,但是省去了类的一些复杂结构,可以像访问类的变量一样去访问,非常酷.&/p&&p&下面这个例子是关于描述52张扑克牌的代码,目前为止是我见到过最巧妙的数据结构,设计非常精秒,值得一读.&/p&&figure&&img src=&https://pic4.zhimg.com/v2-9cbec4aa34aca80d49ae107_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1228& data-rawheight=&848& class=&origin_image zh-lightbox-thumb& width=&1228& data-original=&https://pic4.zhimg.com/v2-9cbec4aa34aca80d49ae107_r.jpg&&&/figure&&p&&i&点评:非常巧妙的利用了namedtuple,大幅的减少了代码的复杂度,简洁的同时又不降低代码的质量,这段代码我足足看了5遍,非常酷!里面还重构的了一些类的内置函数,另有妙用,大家可以自己体会一下.&/i&&/p&&p&&br&&/p&&p&&b&9.非常漂亮的取列表,字典里面的排序&/b&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-aa83b403acbc3ed8ea693da9_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1074& data-rawheight=&440& class=&origin_image zh-lightbox-thumb& width=&1074& data-original=&https://pic2.zhimg.com/v2-aa83b403acbc3ed8ea693da9_r.jpg&&&/figure&&p&&i&点评:利用heapq函数可以非常方便的对单列表,单字典进行排序,而对于复杂的字典组合列表,排序取值也很方便,其实用sorted也可以,二者有异曲同工之妙.&/i&&/p&&p&&br&&/p&&p&&b&结论:&/b& &/p&&p&其实Python的技巧非常非常多,大家平时的写代码或者读代码的时候要注意收集,特别是有一些精妙的招数,一时半会无法领悟,可以记下来,慢慢思考,总有一天会对你的功力增长大有裨益. &/p&&p&&br&&/p&&blockquote&欢迎大家关注 菜鸟学Python&,更多好玩有趣的Python原创教程,趣味算法,经验技巧,行业动态,尽在菜鸟学Python,一起来学python吧&/blockquote&&p&历史人气文章&/p&&p&&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D7b7928feeafab7a64f3e82799ff8fba1%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Python语言如何入门&/a&&/u&&/p&&p&&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3De70dc1ebeaae%26chksm%3Dff1c3ec085eb4bb22203ba45ace8adfbceef438be15%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Python写个迷你聊天机器人|生成器的高级用法&/a&&/u&&/p&&p&&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Daadcaa1af3e3a%26chksm%3Dff1ded233a66cabefe916a1cfddf666b762ac56f300fd%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&同学,学Python真的不能这样学&/a&&/u&&/p&&p&&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D601a6cac0d972c4ef8f52ec9%26chksm%3Da0ff1af54ab18cbe586caab6f6fd96add9e3fd087b1b30ddc8b963bec%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&全网爬取6500多只基金|看看哪家基金最强&/a&&/u&&/p&&p&&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3D5f0a7c5e128a7e%26chksm%3Da0ff1dd33eddebcbf87ae3a3ff8c8scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&用Python破解微软面试题|24点游戏&/a&&/u&&/p&&p&&u&&a href=&https://link.zhihu.com/?target=http%3A//mp.weixin.qq.com/s%3F__biz%3DMzIxNjM4NDE2MA%3D%3D%26mid%3D%26idx%3D1%26sn%3Da659ba1e9a0e3cc9c2a8bdd3%26chksm%3Dff1c0eda6e7905950acc67cc3f8f1f7d181af228b15dba0c970ef0%26scene%3D21%23wechat_redirect& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&一道Google的算法题 |Python巧妙破解&/a&&/u&&/p&
这是菜鸟学Python的第119篇原创文章阅读本文大概需要3分钟 前面我写过一篇文章谈了自己的Python学习经验(),里面谈到"技巧宛如一颗一颗珍珠",后台有好几个小伙伴留言,能不能分享一些技巧. 其实我的公众号里面多多少少分享过一些,今天我分…
&figure&&img src=&https://pic3.zhimg.com/v2-fc3afdd628c96f7b9c850b6e_b.jpg& data-rawwidth=&866& data-rawheight=&695& class=&origin_image zh-lightbox-thumb& width=&866& data-original=&https://pic3.zhimg.com/v2-fc3afdd628c96f7b9c850b6e_r.jpg&&&/figure&&p&相关文章:&/p&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&数据可视化--Seaborn&/a&&/p&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&数据科学--numpy的基本使用&/a&&/p&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&数据科学--Pandas基本使用&/a&&/p&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&数据分析--百年大电影&/a&&/p&&p&&b&&i&目录:&/i&&/b&&/p&&p&&b&&i&No.1 什么是Matplotlib&/i&&/b&&/p&&p&&b&&i&No.2 Matplotlib绘图之plot&/i&&/b&&/p&&p&&b&&i&No.3 Matplotlib绘图之subplot&/i&&/b&&/p&&p&&b&&i&No.4 Pandas绘图之Series&/i&&/b&&/p&&p&&b&&i&No.5 Pandas绘图之DataFrame&/i&&/b&&/p&&p&&b&&i&No.6 直方图和密度图&/i&&/b&&/p&&h2&&b&&i&No.1 什么是Matplotlib&/i&&/b&&/h2&&ol&&li&Matplotlib是一个python的包&/li&&li&用于2D绘图(也可以绘制3D,但是要安装一些支持的工具包)&/li&&li&非常强大非常流行&/li&&li&有很多扩展&/li&&/ol&&p&下面来实现一个很简单的画图操作,可以认为是matploylib的'hello, world !'&/p&&p&我们还是用notebook来操作一下。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-131e6ec6517a7fdec329_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1058& data-rawheight=&1016& class=&origin_image zh-lightbox-thumb& width=&1058& data-original=&https://pic4.zhimg.com/v2-131e6ec6517a7fdec329_r.jpg&&&/figure&&p&看起来是不是很简单,x是在2倍的pi之间取值,取值数量是100,y是用x的值传入sin函数里面。&/p&&p&生成这个图像,但其实后台实现挺复杂的。&/p&&p&下面看看Matplotlibde架构。&/p&&p&Backend:主要处理把图显示到哪里和画到哪里&/p&&p&Artist:图像显示成什么样子&/p&&p&Scripting:pyplot,python语法和API&/p&&h2&&b&No.2 Matplotlib绘图之plot&/b&&/h2&&p&plot这个方法是Matplotlib里面很基本的一个画图方法,我们还是进入notebook来操作。&/p&&p&首先画一个很简单的图。&/p&&figure&&img src=&https://pic1.zhimg.com/v2-8c3f58f84d794f1c0fce_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&984& data-rawheight=&948& class=&origin_image zh-lightbox-thumb& width=&984& data-original=&https://pic1.zhimg.com/v2-8c3f58f84d794f1c0fce_r.jpg&&&/figure&&p&a是一个python的list,有三个取值。那么这张图y坐标取值是1-3,x是0-2,这里a这个list值是1,2,3.所以这里他就是y坐标按照a的值进行取值,x坐标就是按照a这个list的index取值也就是0,1,2.这样就画出了这个图。&/p&&p&现在再把图改一下。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-b37dbaea2ba7fa_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&964& data-rawheight=&810& class=&origin_image zh-lightbox-thumb& width=&964& data-original=&https://pic2.zhimg.com/v2-b37dbaea2ba7fa_r.jpg&&&/figure&&p&这里就改变了,a的值现在是x轴,b的值现在是y轴。这里有个注意点,我们每次画图都要使用plt.show(),这个很麻烦,其实可以省掉这一步,用一个magic method。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-6485bba314bba6e14d45ece8cc77adfa_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&966& data-rawheight=&846& class=&origin_image zh-lightbox-thumb& width=&966& data-original=&https://pic2.zhimg.com/v2-6485bba314bba6e14d45ece8cc77adfa_r.jpg&&&/figure&&p&加上%matplotlib inline就可以避免每次都要操作plt.show()。&/p&&p&除了画出这样的图,还可做出一点小小的修改。比如:&/p&&figure&&img src=&https://pic4.zhimg.com/v2-f9e215b2e59d3bf81cd391e_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&976& data-rawheight=&632& class=&origin_image zh-lightbox-thumb& width=&976& data-original=&https://pic4.zhimg.com/v2-f9e215b2e59d3bf81cd391e_r.jpg&&&/figure&&p&直线变成了星号。&/p&&p&还可以变成虚线&/p&&figure&&img src=&https://pic4.zhimg.com/v2-0ab46ea056ace7ff2a63858_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&962& data-rawheight=&628& class=&origin_image zh-lightbox-thumb& width=&962& data-original=&https://pic4.zhimg.com/v2-0ab46ea056ace7ff2a63858_r.jpg&&&/figure&&p&同时还可以改变颜色。&/p&&figure&&img src=&https://pic3.zhimg.com/v2-1b6eebb1c6d83d80c9f1fa6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&986& data-rawheight=&646& class=&origin_image zh-lightbox-thumb& width=&986& data-original=&https://pic3.zhimg.com/v2-1b6eebb1c6d83d80c9f1fa6_r.jpg&&&/figure&&p&我们在这张图的基础上再加2条线。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-15b509dbeae090d604649_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&968& data-rawheight=&796& class=&origin_image zh-lightbox-thumb& width=&968& data-original=&https://pic2.zhimg.com/v2-15b509dbeae090d604649_r.jpg&&&/figure&&p&再指定几条线的风格。&/p&&figure&&img src=&https://pic1.zhimg.com/v2-64b2e7025b96ffdda1b9_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1010& data-rawheight=&680& class=&origin_image zh-lightbox-thumb& width=&1010& data-original=&https://pic1.zhimg.com/v2-64b2e7025b96ffdda1b9_r.jpg&&&/figure&&p&是不是变了。&/p&&p&下面再举一个更加直观的例子,首先生成两组数据。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-c537f3ccfbbe_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1444& data-rawheight=&966& class=&origin_image zh-lightbox-thumb& width=&1444& data-original=&https://pic4.zhimg.com/v2-c537f3ccfbbe_r.jpg&&&/figure&&p&&br&&/p&&p&t是0-2之间的数字,每个数字之间间隔0.1,s是每一个t的值乘以pi在传给sin函数。&/p&&p&然后画图。&/p&&figure&&img src=&https://pic1.zhimg.com/v2-2d0baa5ee47ef0a084a197f0b9236b82_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1066& data-rawheight=&722& class=&origin_image zh-lightbox-thumb& width=&1066& data-original=&https://pic1.zhimg.com/v2-2d0baa5ee47ef0a084a197f0b9236b82_r.jpg&&&/figure&&p&是不是很有趣。&/p&&p&再给这个图设置一个x,y轴的label&/p&&figure&&img src=&https://pic4.zhimg.com/v2-99cd38e49fbd_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1248& data-rawheight=&750& class=&origin_image zh-lightbox-thumb& width=&1248& data-original=&https://pic4.zhimg.com/v2-99cd38e49fbd_r.jpg&&&/figure&&p&最后再把这个图的信息全部补全。&/p&&figure&&img src=&https://pic1.zhimg.com/v2-a641d1addc24bb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1004& data-rawheight=&944& class=&origin_image zh-lightbox-thumb& width=&1004& data-original=&https://pic1.zhimg.com/v2-a641d1addc24bb_r.jpg&&&/figure&&h2&&b&No.3 Matplotlib绘图之subplot&/b&&/h2&&p&首先subplot可以把上面的图切分开来,先看一个subplot方法的例子。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-000f48e29ad520c6b42a84ecfdefb6a9_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&930& data-rawheight=&1310& class=&origin_image zh-lightbox-thumb& width=&930& data-original=&https://pic2.zhimg.com/v2-000f48e29ad520c6b42a84ecfdefb6a9_r.jpg&&&/figure&&p&其实这就是把整个图像切分成2行1列,拿可不可以变成1行2列呢?肯定可以,把2,1,1改成2,2,1 。把2,1,2改成2,2,2就可以了。看看结果是什么样子。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-baf15a24345b_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&982& data-rawheight=&406& class=&origin_image zh-lightbox-thumb& width=&982& data-original=&https://pic4.zhimg.com/v2-baf15a24345b_r.jpg&&&/figure&&p&实际上这么改,2,2,1是表示2行2列,只是这里只有一行而已,所以只显示1行2列。可以直接在后边再加上。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-545baba435c63c35d952e_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1000& data-rawheight=&1148& class=&origin_image zh-lightbox-thumb& width=&1000& data-original=&https://pic2.zhimg.com/v2-545baba435c63c35d952e_r.jpg&&&/figure&&p&是不是第2行就出来了,还有一个subplots方法也非常的方便。看看如何使用。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-0a1ea7ba35_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1646& data-rawheight=&924& class=&origin_image zh-lightbox-thumb& width=&1646& data-original=&https://pic2.zhimg.com/v2-0a1ea7ba35_r.jpg&&&/figure&&p&2,2就表示画的图是2行2列,ax是一个数组,一共四个value,每一个代表一幅图,现在用之前生成的数据做图看看。&/p&&figure&&img src=&https://pic1.zhimg.com/v2-dfdbc8ece46_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&998& data-rawheight=&756& class=&origin_image zh-lightbox-thumb& width=&998& data-original=&https://pic1.zhimg.com/v2-dfdbc8ece46_r.jpg&&&/figure&&h2&&b&No.4 Pandas绘图之Series&/b&&/h2&&p&还是一样,直接画图,和之前几乎没有什么区别。&/p&&figure&&img src=&https://pic3.zhimg.com/v2-4b88eae555a8c300e0a79be19b7ff372_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&952& data-rawheight=&1424& class=&origin_image zh-lightbox-thumb& width=&952& data-original=&https://pic3.zhimg.com/v2-4b88eae555a8c300e0a79be19b7ff372_r.jpg&&&/figure&&p&这里面的cumsum是累计求和的意思,比如a=[1,2,3,4,5], a.cumsum=[1,3,5,10,15].&/p&&p&这个绘图里面的grid是现实标尺线,label就是图例,title就是图像的名称,style是线的类型。&/p&&p&那现在在这张图里面再加一幅图。&/p&&figure&&img src=&https://pic3.zhimg.com/v2-d96ed2b3489adac81145_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&970& data-rawheight=&964& class=&origin_image zh-lightbox-thumb& width=&970& data-original=&https://pic3.zhimg.com/v2-d96ed2b3489adac81145_r.jpg&&&/figure&&p&代码也非常的简单。下面在用subplots再来试一下看看。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-2d9b13242e92eaea6d4f_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&958& data-rawheight=&860& class=&origin_image zh-lightbox-thumb& width=&958& data-original=&https://pic4.zhimg.com/v2-2d9b13242e92eaea6d4f_r.jpg&&&/figure&&p&2行1列的图就出来了,这里使用ax索引到某一个图来绘制,也可以直接使用Series来plot。&/p&&figure&&img src=&https://pic3.zhimg.com/v2-c78ba44f557ec3b0c8dc13_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1444& data-rawheight=&880& class=&origin_image zh-lightbox-thumb& width=&1444& data-original=&https://pic3.zhimg.com/v2-c78ba44f557ec3b0c8dc13_r.jpg&&&/figure&&p&当然我们也可以画柱状图,来试试看。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-0af9b59f4c00cbcca29f4eb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1548& data-rawheight=&866& class=&origin_image zh-lightbox-thumb& width=&1548& data-original=&https://pic4.zhimg.com/v2-0af9b59f4c00cbcca29f4eb_r.jpg&&&/figure&&h2&&b&No.5 Pandas绘图之DataFrame&/b&&/h2&&p&首先创建一个DataFrame。&/p&&p&画图的话,前面Series直接使用plot画图,那么DataFrame呢?&/p&&figure&&img src=&https://pic2.zhimg.com/v2-090fdb8b7b2db554319bddd1ce5e1ce2_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1088& data-rawheight=&1372& class=&origin_image zh-lightbox-thumb& width=&1088& data-original=&https://pic2.zhimg.com/v2-090fdb8b7b2db554319bddd1ce5e1ce2_r.jpg&&&/figure&&p&好像也可以啊,图例的a,b,c,d就是dataframe里面的a,b,c,d嘛,所以这其实就是每一列画一条曲线,组成这个图。那么把kind换成bar再看看。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-c4f838adb_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1086& data-rawheight=&718& class=&origin_image zh-lightbox-thumb& width=&1086& data-original=&https://pic2.zhimg.com/v2-c4f838adb_r.jpg&&&/figure&&p&这个柱状图好像更好的展示了a,b,c,d的情况啊。还可以改变图的方向。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-d1caa434cd9af00fe98ef23ce7394352_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1098& data-rawheight=&728& class=&origin_image zh-lightbox-thumb& width=&1098& data-original=&https://pic4.zhimg.com/v2-d1caa434cd9af00fe98ef23ce7394352_r.jpg&&&/figure&&p&还可以把4列数据进行堆叠。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-8e6a52d2c2367f79fbac07ad71fdb93c_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1166& data-rawheight=&728& class=&origin_image zh-lightbox-thumb& width=&1166& data-original=&https://pic4.zhimg.com/v2-8e6a52d2c2367f79fbac07ad71fdb93c_r.jpg&&&/figure&&p&这样看着也很清爽啊。还可以做一个填充的图出来。&/p&&figure&&img src=&https://pic3.zhimg.com/v2-3bcaaf1a5c8d7a2816ffb258_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1136& data-rawheight=&748& class=&origin_image zh-lightbox-thumb& width=&1136& data-original=&https://pic3.zhimg.com/v2-3bcaaf1a5c8d7a2816ffb258_r.jpg&&&/figure&&p&还可以选取某一行来做图。比如选择第五行做图。&/p&&figure&&img src=&https://pic1.zhimg.com/v2-089f828a22e27f4b91a166a101bb7252_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&942& data-rawheight=&1114& class=&origin_image zh-lightbox-thumb& width=&942& data-original=&https://pic1.zhimg.com/v2-089f828a22e27f4b91a166a101bb7252_r.jpg&&&/figure&&p&还可以把每一行的数据展示到一张图里面。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-ae7eee7f6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&974& data-rawheight=&694& class=&origin_image zh-lightbox-thumb& width=&974& data-original=&https://pic2.zhimg.com/v2-ae7eee7f6_r.jpg&&&/figure&&p&这里用了循环,但是也可以不用循环,有更便捷的方法&/p&&figure&&img src=&https://pic2.zhimg.com/v2-25a02f09eadbd61c418c_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&942& data-rawheight=&1022& class=&origin_image zh-lightbox-thumb& width=&942& data-original=&https://pic2.zhimg.com/v2-25a02f09eadbd61c418c_r.jpg&&&/figure&&p&先把DataFrame的行和列进行转换不就好操作了嘛。&/p&&p&那么既然每一行可以这样做图,那么每一列肯定也是可以的,比如单独拿出某一列数据做图。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-1c4a78feb60deed980ab8_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&932& data-rawheight=&1104& class=&origin_image zh-lightbox-thumb& width=&932& data-original=&https://pic4.zhimg.com/v2-1c4a78feb60deed980ab8_r.jpg&&&/figure&&h2&&b&No.6 直方图和密度图&/b&&/h2&&p&&b&直方图&/b&&/p&&p&先创建一个Series,然后再绘制直方图。&/p&&figure&&img src=&https://pic4.zhimg.com/v2-ec21d7d49ff8d17f4b9cb1d_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1096& data-rawheight=&1452& class=&origin_image zh-lightbox-thumb& width=&1096& data-original=&https://pic4.zhimg.com/v2-ec21d7d49ff8d17f4b9cb1d_r.jpg&&&/figure&&p&这里的直方图和之前的柱状图好像很类似,但是意思是不大一样的,这里表示的是一种分布情况,这个可能不够清楚,再举一个例子。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-7a09fba03d4ae1f74a10ab94_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&928& data-rawheight=&850& class=&origin_image zh-lightbox-thumb& width=&928& data-original=&https://pic2.zhimg.com/v2-7a09fba03d4ae1f74a10ab94_r.jpg&&&/figure&&p&仔细看这个图,x轴是0-9,y轴是个数,每一个数字出现的次数,也就是分布情况,那么再回去看看上一张图,比如在0-1的取值区间内分布了大概400个数字,所以这个直方图讲的是一个分布情况,这个和之前的柱状图是有区别的。&/p&&p&为了更好的说明,再做一步操作。&/p&&figure&&img src=&https://pic2.zhimg.com/v2-ae3d09edfd6acfe9dcbb2f_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1498& data-rawheight=&1150& class=&origin_image zh-lightbox-thumb& width=&1498& data-original=&https://pic2.zhimg.com/v2-ae3d09edfd6acfe9dcbb2f_r.jpg&&&/figure&&p&仔细看看,这个re是一个tuple,有3个value,第一个是表示频率,也就是出现的次数,第二个就是取值间隔,第三个就是画出来的10个直方。&/p&&p&&b&密度图&/b&&/p&&p&还是使用之前的s来演示。&/p&&figure&&img src=&https://pic3.zhimg.com/v2-e36f6c8eba9a3cdc984eb6_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&1000& data-rawheight=&932& class=&origin_image zh-lightbox-thumb& width=&1000& data-original=&https://pic3.zhimg.com/v2-e36f6c8eba9a3cdc984eb6_r.jpg&&&/figure&&p&这个就是一个密度图,这个看起来和直方图很类似。这个图x轴就是取值范围,y轴就是某个值出现的次数占到总数的百分比,比如0附近的取值占了总取值的40%左右。&/p&&p&-----------------------------------------------------------------------------&/p&&figure&&img src=&https://pic1.zhimg.com/v2-7a6a7f546ae16ec4c22fa_b.jpg& data-caption=&& data-size=&normal& data-rawwidth=&720& data-rawheight=&200& class=&origin_image zh-lightbox-thumb& width=&720& data-original=&https://pic1.zhimg.com/v2-7a6a7f546ae16ec4c22fa_r.jpg&&&/figure&&p&&/p&
相关文章:目录:No.1 什么是MatplotlibNo.2 Matplotlib绘图之plotNo.3 Matplotlib绘图之subplotNo.4 Pandas绘图之SeriesNo.5 Pandas绘图之DataFrameNo.6 直方图…
&p&&b&这里收集的是关于人工智能(AI)的教程、书籍、视频演讲和论文。&/b&&/p&&p&欢迎提供更多的信息。&/p&&h2&在线教程&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-034-artificial-intelligence-fall-2010/lecture-videos& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&麻省理工学院人工智能视频教程&/a& – 麻省理工人工智能课程&/li&&li&&a href=&http://link.zhihu.com/?target=https%3A//www.udacity.com/course/cs271& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&人工智能入门&/a& – 人工智能基础学习。Peter Norvig举办的课程&/li&&li&&a href=&http://link.zhihu.com/?target=https%3A//www.edx.org/course/artificial-intelligence-uc-berkeleyx-cs188-1x-0%23.VMeIsmSsVkg& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&EdX 人工智能&/a& – 此课程讲授人工智能计算机系统设计的基本概念和技术。&/li&&li&&a href=&http://link.zhihu.com/?target=https%3A//www.coursera.org/course/aiplan& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&人工智能中的计划&/a& – 计划是人工智能系统的基础部分之一。在这个课程中,你将会学习到让机器人执行一系列动作所需要的基本算法。&/li&&li&&a href=&http://link.zhihu.com/?target=https%3A//www.class-central.com/mooc/319/udacity-artificial-intelligence-for-robotics& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&机器人人工智能&/a& – 这个课程将会教授你实现人工智能的基本方法,包括:概率推算,计划和搜索,本地化,跟踪和控制,全部都是围绕有关机器人设计。&/li&&li&&a href=&http://link.zhihu.com/?target=https%3A//class.coursera.org/ml-008& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&机器学习&/a& – 有指导和无指导情况下的基本机器学习算法&/li&&li&&a href=&http://link.zhihu.com/?target=https%3A//www.coursera.org/course/neuralnets& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&机器学习中的神经网络&/a& – 智能神经网络上的算法和实践经验&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//online.stanford.edu/course/statistical-learning-winter-2014& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&斯坦福统计学习&/a& -Introductory course on machine learning focusing on: linear and polynomial regression, logistic regression and linear d cross-validation and the bootstrap, model selection and regularization methods (ridge and lasso); nonlinear models, splines and general tree-based methods, random
support-vector machines.&/li&&/ul&&h2&人工智能书籍&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//union.dangdang.com/transfer.php%3Fsys_id%3D1%26ad_type%3D10%26from%3DP-backurl%3Dhttp%253A%252F%252Fproduct.dangdang.com%252Fproduct.aspx%253Fproduct_id%253D& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&人工智能:一种现代的方法&/a& Stuart Russell & Peter Norvig&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.amazon.com/Cambridge-Handbook-Artificial-Intelligence/dp/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&The Cambridge Handbook of Artificial Intelligence&/a& – 适合非专业人士阅读,本书覆盖了基本原则,主要理论和主要研究领域,还有相关主题,比如人造生命。&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.amazon.com/gp/product/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&The Emotion Machine: Commonsense Thinking, Artificial Intelligence, and the Future of the Human Mind &/a&– 在这部让人脑洞大开的图书中,科技先锋继续了他极具创造力的研究,给我们呈现了一个全新的不可思议的人类大脑运转模式。&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.amazon.com/Artificial-Intelligence-Synthesis-Nils-Nilsson/dp/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Artificial Intelligence: A New Synthesis&/a& – 从粒子反应入手,Nilsson逐渐向我们展示了人工智能中最重要和最新的概念。&/li&&/ul&&h2&编程&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.amazon.com/Programming-Artificial-Intelligence-International-Computer/dp/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Prolog Programming for Artificial Intelligence&/a& – 这本针对Prolog和人工智能的畅销书主要讲述了使用Proglog语言编程解决有趣的人工智能问题的基本机制。&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.amazon.co.uk/Algorithms-Data-Structures-Idioms-Prolog/dp/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&AI Algorithms, Data Structures and Idioms in Prolog, Lisp and Java&/a& – &a href=&http://link.zhihu.com/?target=https%3A//dl.dropboxusercontent.com/u/6475135/Luger__1.pdf& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&PDF here&/a&&/li&&/ul&&h2&人工智能原理&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.audible.co.uk/pd/Non-fiction/Superintelligence-Audiobook/B00LPMA33G& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Superintelligence&/a& – 书中问:如果机器在智能上超越人类会怎样。非常好的一本书。&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.audible.co.uk/pd/Non-fiction/Our-Final-Invention-Audiobook/B00KLJMDH8& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Our Final Invention: Artificial Intelligence and the End of the Human Era&/a& – Our Final Invention explores the perils of the heedless pursuit of advanced AI. Until now, human intelligence has had no rival. Can we coexist with beings whose intelligence dwarfs our own? And will they allow us to?&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.audible.com/pd/Science-Technology/How-to-Create-a-Mind-Audiobook/B009S7OKJS/ref%3Da_search_c4_1_1_srTtl%3Fqid%3D%26sr%3D1-1& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&How to Create a Mind: The Secret of Human Thought Revealed&/a& – Ray Kurzweil——谷歌公司的技术主管——向我们展示了如何用反向工程来了解大脑是如何工作的,然后运用这些知识来创造人工智能机器。&/li&&/ul&&h2&免费读物&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//artint.info/html/ArtInt.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Foundations of computational agents&/a& – 这部书由剑桥大学出版社于2010年出版。&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//ai.stanford.edu/%7Enilsson/QAI/qai.pdf& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&The Quest for Artificial Intelligence&/a& – 这本书回顾了人工智能的历史,从早期的18世纪先人的梦想,到如今众多成功的人工智能技术。&/li&&/ul&&h2&程序代码&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//aima.cs.berkeley.edu/lisp/doc/overview.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&AIMA Lisp Source Code&/a& – “Artificial Intelligence A Modern Approach”一书中的Common Lisp源代码。&/li&&/ul&&h2&视频/演讲&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=https%3A//www.youtube.com/watch%3Fv%3Dsc-KbuZqGkI& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&The Unreasonable Effectiveness of Deep Learning&/a& – Dr. Yann LeCun——负责Facebook人工智能研究的主管——他给我们深入讲解了人工智能神经网络和他们对机器学习的应用。&/li&&/ul&&h2&机器学习&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//research.microsoft.com/pubs/209355/DeepLearning-NowPublishing-Vol7-SIG-039.pdf& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Deep Learning. Methods and Applications&/a& 来自微软研究室的免费读物。&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//neuralnetworksanddeeplearning.com/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Neural Networks and Deep Learning&/a& – Neural networks and deep learning currently provide the best solutions to many problems in image recognition, speech recognition, and natural language processing. This book will teach you the core concepts behind neural networks and deep learning&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.amazon.com/Machine-Learning-Probabilistic-Perspective-Computation/dp/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Machine Learning: A Probabilistic Perspective&/a& – 这本小书对机器学习给出了详尽的介绍&/li&&li&&a href=&http://link.zhihu.com/?target=http%3A//www.iro.umontreal.ca/%7Ebengioy/dlbook/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Deep Learning&/a& – Yoshua Bengio, Ian Goodfellow and Aaron Courville put together this currently free (and draft version) book on deep learning. The book is kept up-to-date and covers a wide range of topics in depth (up to and including sequence-to-sequence learning).&/li&&/ul&&h2&其它&/h2&&ul&&li&&a href=&http://link.zhihu.com/?target=http%3A//wiki.opencog.org/w/The_Open_Cognition_Project& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Open Congition Project&/a& – 我们正在努力开发一款具有思考能力的机器。&/li&&/ul&
这里收集的是关于人工智能(AI)的教程、书籍、视频演讲和论文。欢迎提供更多的信息。在线教程 – 麻省理工人工智能课程 – 人工智能基础学习。Peter Norvig举办的课程 – 此课程讲授人工智能计算机系统…
本人曾是一名大数据工程师,项目数据50T,日均数据增长20G左右。&br&&br&个人是从Java后端开发,经过3个月的业余自学成功转型大数据工程师。&br&&br&背景介绍完毕,开始正式一本正经回答问题:&br&&br&本回答目录:&br&一.大数据方向工作介绍&br&二.大数据工程师的技能要求&br&三.大数据学习路径&br&四.学习资源推荐(书籍、博客、网站)&br&&br&&br&一.大数据方向工作介绍&br&&br&大数据方向的工作目前分为三个主要方向:&br&01.大数据工程师&br&02.数据分析师&br&03.大数据科学家&br&04.其他(数据挖掘本质算是机器学习,不过和数据相关,也可以理解为大数据的一个方向吧)&br&&br&二.大数据工程师的技能要求&br&&br&附上二份比较权威的大数据工程师技能图(图侵删)&br&&figure&&img data-rawheight=&1058& src=&https://pic3.zhimg.com/v2-2712bddb7af89fb828271e_b.jpg& data-rawwidth=&720& class=&origin_image zh-lightbox-thumb& width=&720& data-original=&https://pic3.zhimg.com/v2-2712bddb7af89fb828271e_r.jpg&&&/figure&&br&&figure&&img data-rawheight=&1058& src=&https://pic2.zhimg.com/v2-4ab509dd3cf9cf2a571665_b.jpg& data-rawwidth=&720& class=&origin_image zh-lightbox-thumb& width=&720& data-original=&https://pic2.zhimg.com/v2-4ab509dd3cf9cf2a571665_r.jpg&&&/figure&&br&总结如下:&br&&br&必须技能10条:&br&01.Java高级(虚拟机、并发)&br&02.Linux 基本操作&br&03.Hadoop(此处为侠义概念单指HDFS+MapReduce+Yarn )&br&04.HBase(JavaAPI操作+Phoenix )&br&05.Hive(Hql基本操作和原理理解)&br&06.Kafka &br&07.Storm&br&08.Scala需要&br&09.Python&br&10.Spark (Core+sparksql+Spark streaming )&br&11.一些小工具(Sqoop等)&br&&br&高阶技能6条:&br&11.机器学习算法以及mahout库加MLlib&br&12.R语言&br&13.Lambda 架构&br&14.Kappa架构&br&15.Kylin&br&16.Aluxio&br&&br&三.学习路径&br&&br&由于本人是从Java开发通过大概3个月的自学转到大数据开发的。所以我主要分享一下自己的学习路劲。&br&&br&第一阶段:&br&01.Linux学习(跟鸟哥学就ok了)&br&02.Java 高级学习(《深入理解Java虚拟机》、《Java高并发实战》)&br&&br&第二阶段:&br&03.Hadoop (董西成的书)&br&04.HBase(《HBase权威指南》)&br&05.Hive(《Hive开发指南》)&br&06.Scala(《快学Scala》)&br&07.Spark (《Spark 快速大数据分析》)&br&08.Python (跟着廖雪峰的博客学习就ok了)&br&&br&第三阶段:&br&对应技能需求,到网上多搜集一些资料就ok了,我把最重要的事情(要学什么告诉你了),&br&剩下的就是你去搜集对应的资料学习就ok了&br&&br&当然如果你觉得自己看书效率太慢,你可以网上搜集一些课程,跟着课程走也OK 。这个完全根据自己情况决定。如果看书效率不高就很网课,相反的话就自己看书。&br&&br&四.学习资源推荐:&br&&br&01.Apache 官网&br&02.Stackoverflow&br&04.github&br&03.Cloudra官网&br&04.Databrick官网&br&05.过往的记忆(技术博客)&br&06.CSDN,51CTO &br&07.至于书籍当当一搜会有很多,其实内容都差不多。&br&&br&最后但却很重要一点:要多关注技术动向,持续学习。&br&&figure&&img data-rawheight=&297& src=&https://pic2.zhimg.com/v2-7f5d05b625_b.jpg& data-rawwidth=&477& data-tags=&emoji& class=&origin_image zh-lightbox-thumb& width=&477& data-original=&https://pic2.zhimg.com/v2-7f5d05b625_r.jpg&&&/figure&
本人曾是一名大数据工程师,项目数据50T,日均数据增长20G左右。 个人是从Java后端开发,经过3个月的业余自学成功转型大数据工程师。 背景介绍完毕,开始正式一本正经回答问题: 本回答目录: 一.大数据方向工作介绍 二.大数据工程师的技能要求 三.大数据学习…
&p&[本文主要介绍SGD算法,和两篇分析它逃离鞍点的论文: 我与鬲融,金驰,黄芙蓉写的Escaping From Saddle Points – Online Stochastic Gradient for Tensor Decomposition, 以及由金驰,鬲融等人写的最新力作:How to Escape Saddle Points Efficiently]&/p&&p&&br&&/p&&p&假如我们要优化一个函数 &img src=&https://www.zhihu.com/equation?tex=f%28x%29& alt=&f(x)& eeimg=&1&& ,即找到它的最小值, 常用的方法叫做Gradient Descent (GD), 也就是最速下降法. 说起来很简单, 就是每次沿着当前位置的导数方向走一小步, 走啊走啊就能够走到一个好地方了.&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-bab3d9ecaf5_b.jpg& data-rawwidth=&703& data-rawheight=&366& class=&origin_image zh-lightbox-thumb& width=&703& data-original=&https://pic1.zhimg.com/v2-bab3d9ecaf5_r.jpg&&&/figure&&p&&br&&/p&&p&如上图, 就像你下山一样, 每一步你都挑最陡的路走, 如果最后你没摔死的话, 一般你很快就能够走到山脚. 用数学表示一下, 就是&/p&&p&&img src=&https://www.zhihu.com/equation?tex=x_%7Bt%2B1%7D%3Dx_t-%5Ceta_t+%5Cnabla+f%28x_t%29& alt=&x_{t+1}=x_t-\eta_t \nabla f(x_t)& eeimg=&1&&&/p&&p&这里 &img src=&https://www.zhihu.com/equation?tex=x_t& alt=&x_t& eeimg=&1&& 就是第t步的位置, &img src=&https://www.zhihu.com/equation?tex=%5Cnabla+f%28x_t%29& alt=&\nabla f(x_t)& eeimg=&1&& 就是导数, &img src=&https://www.zhihu.com/equation?tex=%5Ceta_t& alt=&\eta_t& eeimg=&1&& 是步长. 所以这个算法非常简单, 就是反复做这个一行的迭代.&/p&&p&虽然简单优美, 但GD算法至少有两个明显的缺陷 (其实有更多啦,但今天先讲这两个..) . &/p&&p&首先, 在使用的时候, 尤其是机器学习的应用中, 我们都会面临非常大的数据集. 这个时候如果硬要算 &img src=&https://www.zhihu.com/equation?tex=f%28x%29& alt=&f(x)& eeimg=&1&& 的精确导数(也别管 &img src=&https://www.zhihu.com/equation?tex=f%28x%29& alt=&f(x)& eeimg=&1&& 是什么了, 反正每个机器学习算法里面都有这么个东西..), 往往意味着我们要花几个小时把整个数据集都扫描一遍, 然后还只能走一小步. 一般GD要几千步几万步才能收敛, 所以这样就根本跑不完了. &/p&&p&其次, 如果我们不小心陷入了鞍点, 或者比较差的局部最优点, GD算法就跑不出来了, 因为这些点的导数是0. 什么是鞍点:&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-6d77d47caae61d7a5d91b_b.jpg& data-rawwidth=&252& data-rawheight=&200& class=&content_image& width=&252&&&/figure&&p&什么是局部最优点(下图右边):&/p&&p&&br&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-a1dc_b.jpg& data-rawwidth=&473& data-rawheight=&317& class=&origin_image zh-lightbox-thumb& width=&473& data-original=&https://pic2.zhimg.com/v2-a1dc_r.jpg&&&/figure&&p&&br&&/p&&p&有趣的是, 这两大缺陷竟然可以用同一个方法解决, 就是我们今天要谈的Stochastic Gradient Descent (SGD) 算法. &/p&&p&SGD 算法的表达式和GD差不多:&/p&&p&&img src=&https://www.zhihu.com/equation?tex=x_%7Bt%2B1%7D%3Dx_t-%5Ceta_t+g_t& alt=&x_{t+1}=x_t-\eta_t g_t& eeimg=&1&&&/p&&p&这里 &img src=&https://www.zhihu.com/equation?tex=g_t+& alt=&g_t & eeimg=&1&&就是所谓的Stochastic Gradient,它满足 &img src=&https://www.zhihu.com/equation?tex=E%5Bg_t%5D%3D%5Cnabla+f%28x_t%29& alt=&E[g_t]=\nabla f(x_t)& eeimg=&1&&&/p&&p&也就是说,虽然包含一定的随机性,但是从期望上来看,它是等于正确的导数的.用一张图来表示,其实SGD就像是喝醉了酒的GD,它依稀认得路,最后也能自己走回家,但是走得歪歪扭扭.(红色的是GD的路线,偏粉红的是SGD的路线).&/p&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-1a00a70c4ff460bf2aedb9c_b.jpg& data-rawwidth=&388& data-rawheight=&309& class=&content_image& width=&388&&&/figure&&p&仔细看的话,其实SGD需要更多步才能够收敛的,毕竟它喝醉了.可是,由于它对导数的要求非常低,可以包含大量的噪声,只要期望正确就行(有时候期望不对都是可以的..),所以导数算起来&b&非常快&/b&.就我刚才说的机器学习的例子,比如神经网络吧,训练的时候都是每次只从百万数据点里面拿128或者256个数据点,算一个不那么准的导数,然后用SGD走一步的.想想看,这样每次算的时间就快了10000倍,就算是多走几倍的路,算算也是挺值的了.&/p&&figure&&img src=&https://pic3.zhimg.com/v2-4efacefaef760a7c8cc96f5_b.jpg& data-rawwidth=&740& data-rawheight=&372& class=&origin_image zh-lightbox-thumb& width=&740& data-original=&https://pic3.zhimg.com/v2-4efacefaef760a7c8cc96f5_r.jpg&&&/figure&&p&&br&&/p&&p&所以它可以完美解决GD的第一个问题--算得慢.这也是当初人们使用SGD的主要目的.而且,大家并不用担心导数中包含的噪声会有什么负面影响.有大量的理论工作说明,只要噪声不离谱,其实(至少在f是凸函数的情况下),SGD都能够很好地收敛.&/p&&p&虽然搞理论的人这么说,但是很多完美主义者仍会惴惴不安,觉得用带了随机噪声的导数来训练自己的神经网络不放心,一定要用最准确的导数才行.于是他们往往还会尝试用GD跑一遍,和SGD得到的结果比较比较. &/p&&p&结果呢?因为我经常干这样的事情,所以我可以负责任地告诉大家,哪怕GD训练的时候有多几百倍几千倍的时间,最后结果往往是SGD得到的网络表现要比GD得到的网络要&b&好得多&/b&!&/p&&p&很意外是不是?加了噪声的算法反而更好,这简直就像说"让马路上的司机多喝点酒,交通能够更顺畅"一样让人难以接受.&/p&&p&但事实就是如此.实践中,人们发现,除了算得快,SGD有非常多的优良性质.它能够自动逃离鞍点,自动逃离比较差的局部最优点,而且,最后找到的答案还具有很强的一般性(generalization),即能够在自己之前没有见过但是服从同样分布的数据集上表现非常好!&/p&&p&这是为什么呢?今天我们就简单谈谈为什么它可以逃离鞍点.之后有机会我会再详细介绍SGD的别的优良性质--这些性质也是目前优化和机器学习领域研究的热点问题.&/p&&p&那么我们先理解一下,鞍点的数学表达是什么.&/p&&p&首先,我们考虑的情况是导数为0的点.这些点被称为Stationary points,即稳定点.稳定点的话,可以是(局部)最小值,(局部)最大值,也可以是鞍点.如何判断呢?我们可以计算它的Hessian矩阵H.&/p&&ul&&li&如果H是负定的,说明所有的特征值都是负的.这个时候,你无论往什么方向走,导数都会变负,也就是说函数值会下降.所以,这是(局部)最大值.&/li&&li&如果H是正定的,说明所有的特征值都是正的.这个时候,你无论往什么方向走,导数都会变正,也就是说函数值会上升.所以,这是(局部)最小值.&/li&&li&如果H既包含正的特征值,又包含负的特征值,那么这个稳定点就是一个鞍点.具体参照之前的图片.也就是说有些方向函数值会上升,有些方向函数值会下降.&/li&&li&虽然看起来上面已经包含了所有的情况,但是其实不是的!还有一个非常重要的情况就是H可能包含特征值为0的情况.这种情况下面,我们无法判断稳定点到底属于哪一类,往往需要参照更高维的导数才行.想想看,如果特征值是0,就说明有些方向一马平川一望无际,函数值一直不变,那我们当然不知道是怎么回事了:)&/li&&/ul&&p&我们今天讨论的情况只包含前三种,不包含第四种.第四种被称为退化了的情况,所以我们考虑的情况就叫做非退化情况.&/p&&p&在这种非退化的情况下面,我们考虑一个重要的类别,即strict saddle函数.这种函数有这样的特点:对于每个点x&/p&&ul&&li&要么x的导数比较大&/li&&li&要么x的Hessian矩阵包含一个负的特征值&/li&&li&要么x已经离某一个(局部)最小值很近了&/li&&/ul&&p&为什么我们要x满足这三个情况的至少一个呢?因为&/p&&ul&&li&如果x的导数大,那么沿着这个导数一定可以大大降低函数值(我们对函数有光滑性假设)&/li&&li&如果x的Hessian矩阵有一个负的特征值,那么我们通过加噪声随机扰动,跑跑就能够跑到这个方向上,沿着这个方向就能够像滑滑梯一样一路滑下去,大大降低函数值&/li&&li&如果x已经离某一个(局部)最小值很近了,那么我们就完成任务了,毕竟这个世界上没有十全十美的事情,离得近和精确跑到这个点也没什么区别.&/li&&/ul&&p&所以说,如果我们考虑的函数满足这个strict saddle性质,那么SGD算法其实是不会被困在鞍点的.那么strict saddle性质是不是一个合理的性质呢?&/p&&p&实际上,有大量的机器学习的问题使用的函数都满足这样的性质.比如Orthogonal tensor decomposition,dictionary learning, matrix completion等等.而且,其实并不用担心最后得到的点只是一个局部最优,而不是全局最优.因为实际上人们发现大量的机器学习问题,几乎所有的局部最优是几乎一样好的,也就是说,只要找到一个局部最优点,其实就已经找到了全局最优,比如Orthogonal tensor decomposition就满足这样的性质,还有小马哥NIPS16的best student paper证明了matrix completion也满足这样的性质.我觉得神经网络从某些角度来看,也是(几乎)满足的,只是不知道怎么证..&/p&&p&&br&&/p&&p&下面讨论一下证明,主要讨论一下第二篇.第一篇论文其实就是用数学的语言在说"在鞍点加扰动,能够顺着负的特征值方向滑下去".第二篇非常有意思,我觉得值得介绍一下想法.&/p&&p&首先,算法上有了一些改动.算法不再是SGD,而是跑若干步GD,然后跑一步SGD.当然实际上大家是不会这么用的,但是理论分析么,这么考虑没问题.什么时候跑SGD呢?只有当导数比较小,而且已经很长时间没有跑过SGD的时候,才会跑一次.也就是说,只有确实陷在鞍点上了,才会随机扰动一下下.&/p&&p&因为鞍点有负的特征值,所以只要扰动之后在这个方向上有那么一点点分量,就能够一马平川地滑下去.除非分量非常非常小的情况下才可能会继续陷在鞍点附近.换句话说,如果加了一个随机扰动,其实大概率情况下是能够逃离鞍点的!&/p&&p&虽然这个想法也很直观,但是要严格地证明很不容易,因为具体函数可能是很复杂的,Hessian矩阵也在不断地变化,所以要说明"扰动之后会陷在鞍点附近的概率是小概率"这件事情并不容易.&/p&&p&&br&&/p&&p&作者们采取了一个很巧妙的方法:对于负特征值的那个方向,任何两个点在这两个方向上的投影的距离只要大于u/2, 那么它们中间至少有一个点能够通过多跑几步GD逃离鞍点.也就是说,会持续陷在鞍点附近的点所在的区间至多只有u那么宽!通过计算宽度,我们也就可以计算出概率的上届,说明大概率下这个SGD+GD算法能够逃离鞍点了.&/p&&p&[原文Figure 1画得很漂亮,推荐一下]&/p&&p&&/p&
[本文主要介绍SGD算法,和两篇分析它逃离鞍点的论文: 我与鬲融,金驰,黄芙蓉写的Escaping From Saddle Points – Online Stochastic Gradient for Tensor Decomposition, 以及由金驰,鬲融等人写的最新力作:How to Escape Saddle Points Efficiently] 假…
&figure&&img src=&https://pic4.zhimg.com/v2-0cbd3e0bf958a_b.jpg& data-rawwidth=&601& data-rawheight=&794& class=&origin_image zh-lightbox-thumb& width=&601& data-original=&https://pic4.zhimg.com/v2-0cbd3e0bf958a_r.jpg&&&/figure&&p&写这篇目的是总结记录一下工作过程中遇到的问题和解决方案,同时接受各位大神的指导。&/p&&p&目前,很多网站为了反爬都会采取各种各样的策略,比较简单粗暴的一种做法就是图片验证码,随着爬虫技术与反爬技术的演变,目前验证码也越来越复杂,比较高端的如Google的I‘m not a robot,极验等等。这些新的反爬方式大多都基于用户行为分析用户点击前的鼠标轨迹来判断是访问者是程序还是人。&/p&&p&这篇文章介绍的是破解一般“传统”的图片验证码的步骤。上面提到的极验(目前应用比较广)也已经可以被破解,知乎上有相关的专栏,我早前无聊的时候跟着做用Java破解过,这里就不重复了。&/p&&p&即便是传统的图片验证码,也是有难度区分的(第一张图是我母校官网上的验证码,基本形同虚设;第二张图则是某网站的会员登录时的验证码增加了一些干扰信息,字符也有所粘连),但是破解的流程大致是一样的。&/p&&p&图1&/p&&figure&&img src=&https://pic2.zhimg.com/v2-d8de8a67933ecc9bfb19801_b.jpg& data-rawwidth=&108& data-rawheight=&20& class=&content_image& width=&108&&&/figure&&p&&br&&/p&&p&图2&/p&&figure&&img src=&https://pic1.zhimg.com/v2-2ada16409db4_b.jpg& data-rawwidth=&300& data-rawheight=&100& class=&content_image& width=&300&&&/figure&&p&&br&&/p&&p&&br&&/p&&p&识别步骤&/p&&p&一、获取样本&/p&&p&从目标网站获取了5000个验证码图片到本地,作为样本。因为后期需要进行机器学习样本量要足够大。&/p&&p&&br&&/p&&p&二,样本去噪&/p&&p&1,先二值化图片&/p&&p&这一步是为了增强图片的对比度,利于后期图片图像处理,代码如下(没怎么写过python如果有什么低级错误请见谅):&/p&&div class=&highlight&&&pre&&code class=&language-python&&&span&&/span&&span class=&c1&&# 二值化图片&/span&
&span class=&nd&&@staticmethod&/span&
&span class=&k&&def&/span& &span class=&nf&&two_value_img&/span&&span class=&p&&(&/span&&span class=&n&&img_path&/span&&span class=&p&&,&/span& &span class=&n&&threshold&/span&&span class=&p&&):&/span&
&span class=&n&&img&/span& &span class=&o&&=&/span& &span class=&n&&Image&/span&&span class=&o&&.&/span&&span class=&n&&open&/span&&span class=&p&&(&/span&&span class=&n&&img_path&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&convert&/span&&span class=&p&&(&/span&&span class=&s1&&'L'&/span&&span class=&p&&)&/span&
&span class=&c1&&#
setup a converting table with constant threshold&/span&
&span class=&n&&tables&/span& &span class=&o&&=&/span& &span class=&p&&[]&/span&
&span class=&k&&for&/span& &span class=&n&&i&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&mi&&256&/span&&span class=&p&&):&/span&
&span class=&k&&if&/span& &span class=&n&&i&/span& &span class=&o&&&&/span& &span class=&n&&threshold&/span&&span class=&p&&:&/span&
&span class=&n&&tables&/span&&span class=&o&&.&/span&&span class=&n&&append&/span&&span class=&p&&(&/span&&span class=&mi&&0&/span&&span class=&p&&)&/span&
&span class=&k&&else&/span&&span class=&p&&:&/span&
&span class=&n&&tables&/span&&span class=&o&&.&/span&&span class=&n&&append&/span&&span class=&p&&(&/span&&span class=&mi&&1&/span&&span class=&p&&)&/span&
&span class=&c1&&# convert to binary image by the table&/span&
&span class=&n&&bim&/span& &span class=&o&&=&/span& &span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&point&/span&&span class=&p&&(&/span&&span class=&n&&tables&/span&&span class=&p&&,&/span& &span class=&s1&&'1'&/span&&span class=&p&&)&/span&
&span class=&k&&return&/span& &span class=&n&&bim&/span&
&/code&&/pre&&/div&&p&效果如下:&/p&&p&&br&&/p&&figure&&img src=&https://pic4.zhimg.com/v2-fb686a4b03bdf9eafd5e54ede12a8df7_b.jpg& data-rawwidth=&300& data-rawheight=&100& class=&content_image& width=&300&&&/figure&&p&&br&&/p&&p&&br&&/p&&p&&br&&/p&&p&2,图片去噪&/p&&p&该案例中就是去除两条干扰线,常规的去噪算法有很多(洪水法等等),这里根据图片的特点采用了两种去噪算法,一种是自己根据图片的特征实现的算法,另一种是“八值法”。去噪后的效果如下,可以看到去除了大部分的干扰线(剩下的根据字宽可以直接过滤掉),但是部分字符也变细了,所以这一步的去噪阀值需要不断调整,在去噪的基础上要尽量保持原图的完整和可读性。&/p&&p&代码如下:&/p&&div class=&highlight&&&pre&&code class=&language-python&&&span&&/span&&span class=&c1&&# 根据图片特点,自己写的降噪算法&/span&
&span class=&k&&def&/span& &span class=&nf&&clean_img&/span&&span class=&p&&(&/span&&span class=&n&&img&/span&&span class=&p&&,&/span& &span class=&n&&threshold&/span&&span class=&p&&):&/span&
&span class=&n&&width&/span&&span class=&p&&,&/span& &span class=&n&&height&/span& &span class=&o&&=&/span& &span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&size&/span&
&span class=&k&&for&/span& &span class=&n&&j&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&height&/span&&span class=&p&&):&/span&
&span class=&k&&for&/span& &span class=&n&&i&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&width&/span&&span class=&p&&):&/span&
&span class=&n&&point&/span& &span class=&o&&=&/span& &span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&getpixel&/span&&span class=&p&&((&/span&&span class=&n&&i&/span&&span class=&p&&,&/span& &span class=&n&&j&/span&&span class=&p&&))&/span&
&span class=&k&&if&/span& &span class=&n&&point&/span& &span class=&o&&==&/span& &span class=&mi&&0&/span&&span class=&p&&:&/span&
&span class=&k&&for&/span& &span class=&n&&x&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&threshold&/span&&span class=&p&&):&/span&
&span class=&k&&if&/span& &span class=&n&&j&/span& &span class=&o&&+&/span& &span class=&n&&x&/span& &span class=&o&&&=&/span& &span class=&n&&height&/span&&span class=&p&&:&/span&
&span class=&k&&break&/span&
&span class=&k&&else&/span&&span class=&p&&:&/span&
&span class=&k&&if&/span& &span class=&n&&point&/span& &span class=&o&&!=&/span& &span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&getpixel&/span&&span class=&p&&((&/span&&span class=&n&&i&/span&&span class=&p&&,&/span& &span class=&n&&j&/span& &span class=&o&&+&/span& &span class=&n&&x&/span&&span class=&p&&)):&/span&
&span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&putpixel&/span&&span class=&p&&((&/span&&span class=&n&&i&/span&&span class=&p&&,&/span& &span class=&n&&j&/span&&span class=&p&&),&/span& &span class=&mi&&1&/span&&span class=&p&&)&/span&
&span class=&k&&break&/span&
&span class=&k&&return&/span& &span class=&n&&img&/span&
&span class=&c1&&# 八值法降噪&/span&
&span class=&k&&def&/span& &span class=&nf&&clean_img_eight&/span&&span class=&p&&(&/span&&span class=&n&&img&/span&&span class=&p&&,&/span& &span class=&n&&threshold&/span&&span class=&p&&):&/span&
&span class=&n&&width&/span&&span class=&p&&,&/span& &span class=&n&&height&/span& &span class=&o&&=&/span& &span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&size&/span&
&span class=&n&&arr&/span& &span class=&o&&=&/span& &span class=&p&&[[&/span&&span class=&mi&&0&/span& &span class=&k&&for&/span& &span class=&n&&col&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&width&/span&&span class=&p&&)]&/span& &span class=&k&&for&/span& &span class=&n&&row&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&height&/span&&span class=&p&&)]&/span&
&span class=&n&&arr&/span& &span class=&o&&=&/span& &span class=&n&&array&/span&&span class=&p&&(&/span&&span class=&n&&arr&/span&&span class=&p&&)&/span&
&span class=&k&&for&/span& &span class=&n&&j&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&height&/span&&span class=&p&&):&/span&
&span class=&k&&for&/span& &span class=&n&&i&/span& &span class=&ow&&in&/span& &span class=&nb&&range&/span&&span class=&p&&(&/span&&span class=&n&&width&/span&&span class=&p&&):&/span&
&span class=&n&&point&/span& &span class=&o&&=&/span& &span class=&n&&img&/span&&span class=&o&&.&/span&&span class=&n&&getpixel&/span&&span class=&p&&((&/span&&span class=&n&&i&/span&&span class=&p&&,&/span& &span class=&n&&j&/span&&span class=&p&&))&/span&
&span class=&k&&if&/span& &span class=&n&&point&/span& &span class=&o&&==&/sp

我要回帖

更多关于 求好心人领养 的文章

 

随机推荐