<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0</id>
	<title>使用python建模人工神经网络及进行深度学习 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.swarma.org/index.php?action=history&amp;feed=atom&amp;title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0"/>
	<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;action=history"/>
	<updated>2026-11-03T05:07:55Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;diff=34768&amp;oldid=prev</id>
		<title>13944556914：/* 对处理结果的讨论 */</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;diff=34768&amp;oldid=prev"/>
		<updated>2024-05-21T07:56:11Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;对处理结果的讨论&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2024年5月21日 (二) 07:56的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l106&quot; &gt;第106行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第106行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;category&lt;/del&gt;:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;python]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Category&lt;/ins&gt;:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;待润色&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;[[category:旧词条迁移&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>13944556914</name></author>
	</entry>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;diff=15439&amp;oldid=prev</id>
		<title>2020年10月16日 (五) 01:57 思无涯咿呀咿呀</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;diff=15439&amp;oldid=prev"/>
		<updated>2020-10-16T01:57:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2020年10月16日 (五) 01:57的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l107&quot; &gt;第107行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第107行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:python]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[category:python]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[category:旧词条迁移]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>思无涯咿呀咿呀</name></author>
	</entry>
	<entry>
		<id>https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;diff=15438&amp;oldid=prev</id>
		<title>思无涯咿呀咿呀：创建页面，内容为“本篇主要由计算士整理  ==理论模型==  本页面主要内容来自[http://deeplearning.net/tutorial/lenet.html 这里]  有多层神经元  File:CNN1.pn…”</title>
		<link rel="alternate" type="text/html" href="https://wiki.swarma.org/index.php?title=%E4%BD%BF%E7%94%A8python%E5%BB%BA%E6%A8%A1%E4%BA%BA%E5%B7%A5%E7%A5%9E%E7%BB%8F%E7%BD%91%E7%BB%9C%E5%8F%8A%E8%BF%9B%E8%A1%8C%E6%B7%B1%E5%BA%A6%E5%AD%A6%E4%B9%A0&amp;diff=15438&amp;oldid=prev"/>
		<updated>2020-10-16T01:53:19Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“本篇主要由计算士整理  ==理论模型==  本页面主要内容来自[http://deeplearning.net/tutorial/lenet.html 这里]  有多层神经元  File:CNN1.pn…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;本篇主要由计算士整理&lt;br /&gt;
&lt;br /&gt;
==理论模型==&lt;br /&gt;
&lt;br /&gt;
本页面主要内容来自[http://deeplearning.net/tutorial/lenet.html 这里]&lt;br /&gt;
&lt;br /&gt;
有多层神经元&lt;br /&gt;
&lt;br /&gt;
[[File:CNN1.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
高层神经元控制（接受）底层神经元的输入&lt;br /&gt;
&lt;br /&gt;
[[File:CNN2.png|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
使用卷积来定义不同层神经元之间的作用，回忆一维卷积的效果&lt;br /&gt;
&lt;br /&gt;
[[File:CNN3.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
可以将一维卷积推广到二维卷积&lt;br /&gt;
&lt;br /&gt;
[[File:CNN4.png|500px]]&lt;br /&gt;
&lt;br /&gt;
卷积是很有意思的东西，是The common patterns in nature一文中的核心概念。可以简单解释如下（来自我以前写的文章《统计之道：墨子见鬼谷子》）：&lt;br /&gt;
&lt;br /&gt;
[[File:cv_figure3.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:cv_figure2.png|600px]]&lt;br /&gt;
&lt;br /&gt;
[[File:cv_figure1.png|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
图层之间的作用示例&lt;br /&gt;
&lt;br /&gt;
[[File:CNN5.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
更具体完整的模型如下所示（lenet）&lt;br /&gt;
&lt;br /&gt;
[[File:CNN6.png|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==准备一个图像数据==&lt;br /&gt;
&lt;br /&gt;
[[File:CNN7.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
我们将使用以下对图片进行处理&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==示例代码==&lt;br /&gt;
&lt;br /&gt;
    import theano&lt;br /&gt;
    import theano.tensor as T&lt;br /&gt;
    import pylab&lt;br /&gt;
    from PIL import Image&lt;br /&gt;
    import cPickle, gzip, numpy&lt;br /&gt;
    from theano.tensor.nnet import conv&lt;br /&gt;
    &lt;br /&gt;
    rng = numpy.random.RandomState(23455)&lt;br /&gt;
    input = T.tensor4(name='input')&lt;br /&gt;
    # initialize shared variable for weights.&lt;br /&gt;
    w_shp = (2, 3, 9, 9)&lt;br /&gt;
    w_bound = numpy.sqrt(3 * 9 * 9)&lt;br /&gt;
    W = theano.shared( numpy.asarray(&lt;br /&gt;
                rng.uniform(&lt;br /&gt;
                    low=-1.0 / w_bound,&lt;br /&gt;
                    high=1.0 / w_bound,&lt;br /&gt;
                    size=w_shp),&lt;br /&gt;
                dtype=input.dtype), name ='W')&lt;br /&gt;
    &lt;br /&gt;
    b_shp = (2,)&lt;br /&gt;
    b = theano.shared(numpy.asarray(&lt;br /&gt;
                rng.uniform(low=-.5, high=.5, size=b_shp),&lt;br /&gt;
                dtype=input.dtype), name ='b')&lt;br /&gt;
    &lt;br /&gt;
    conv_out = conv.conv2d(input, W)&lt;br /&gt;
    output = T.nnet.sigmoid(conv_out + b.dimshuffle('x', 0, 'x', 'x'))&lt;br /&gt;
    f = theano.function([input], output)&lt;br /&gt;
    # open random image of dimensions 639x516&lt;br /&gt;
    img = Image.open('E:/wulingfei/pkuwinter.jpg')&lt;br /&gt;
    (width, height) = img.size&lt;br /&gt;
    img = numpy.asarray(img, dtype='float64') / 256.&lt;br /&gt;
    # put image in 4D tensor of shape (1, 3, height, width)&lt;br /&gt;
    img_ = img.swapaxes(0, 2).swapaxes(1, 2).reshape(1, 3, height, width)&lt;br /&gt;
    filtered_img = f(img_)&lt;br /&gt;
    &lt;br /&gt;
    plt.figure(1,figsize=(7,15))&lt;br /&gt;
    # plot original image and first and second components of output&lt;br /&gt;
    pylab.subplot(3, 1, 1); pylab.axis('off'); pylab.imshow(img)&lt;br /&gt;
    pylab.gray();&lt;br /&gt;
    # recall that the convOp output (filtered image) is actually a &amp;quot;minibatch&amp;quot;,&lt;br /&gt;
    # of size 1 here, so we take index 0 in the first dimension:&lt;br /&gt;
    pylab.subplot(3, 1, 2); pylab.axis('off'); pylab.imshow(filtered_img[0, 0, :, :])&lt;br /&gt;
    pylab.subplot(3, 1, 3); pylab.axis('off'); pylab.imshow(filtered_img[0, 1, :, :])&lt;br /&gt;
&lt;br /&gt;
==对处理结果的讨论==&lt;br /&gt;
&lt;br /&gt;
处理的结果如下图所示&lt;br /&gt;
&lt;br /&gt;
[[File:CNN8.png|500px]]&lt;br /&gt;
&lt;br /&gt;
所谓的“深度学习”（deep learning）里的“深度”其实就是人工神经网络的层次。我们这里介绍的卷积神经网络是各类深度学习模型中的一种。因为机器的增强-特别是并行计算，和数据量的加大，使得构建多层的人工神经网络模型变得可行。经过多层的处理，高层的神经元可以以非线性的方式储藏底层神经元的信息，最终形成对原始图像的抽象特征的理解。例如在这个例子中，我们识别出了图象的“边缘”。这样的学习，比起单纯地用一个分线性的分类器，例如logistic或者SVM，来理解数据里的非线性结构，无疑是更深刻的，也更贴近人脑的工作方式：使用抽象概念描述世界。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category:python]]&lt;/div&gt;</summary>
		<author><name>思无涯咿呀咿呀</name></author>
	</entry>
</feed>