<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>PyTorch 介绍 on chinese</title><link>https://www.xiexianbin.cn/ai/pytorch/</link><description>Recent content in PyTorch 介绍 on chinese</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><lastBuildDate>Sat, 24 Jun 2023 10:36:06 +0800</lastBuildDate><atom:link href="https://www.xiexianbin.cn/ai/pytorch/index.xml" rel="self" type="application/rss+xml"/><item><title>PyTorch 卷积神经网络示例</title><link>https://www.xiexianbin.cn/ai/pytorch/pytorch-cnn-demo/</link><pubDate>Sat, 03 May 2025 18:22:35 +0800</pubDate><guid>https://www.xiexianbin.cn/ai/pytorch/pytorch-cnn-demo/</guid><description>&lt;blockquote&gt;
&lt;p&gt;本文详细介绍如何基于 PyTorch CPU 构建一个卷积神经网络 (CNN) 来对 CIFAR-10 图片进行分类。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2 id="介绍"&gt;介绍&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;构建一个经典的卷积神经网络 (CNN, convolution neural network)，对 CIFAR-10 数据集中的图像进行分类&lt;/li&gt;
&lt;li&gt;CNN 是一类神经网络，定义为用于检测数据中复杂特征的多层神经网络，它最常用于计算机视觉应用&lt;/li&gt;
&lt;li&gt;本次示例 CNN 网络结构将包括以下 14 层：&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="code-block-wrapper code-collapsible" data-language="text"&gt;
&lt;div class="code-block-header"&gt;
&lt;svg
class="code-icon"
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2.5"
stroke-linecap="round"
stroke-linejoin="round"
&gt;
&lt;polyline points="16 18 22 12 16 6"&gt;&lt;/polyline&gt;
&lt;polyline points="8 6 2 12 8 18"&gt;&lt;/polyline&gt;
&lt;/svg&gt;
&lt;span class="code-language"&gt;text&lt;/span&gt;
&lt;/div&gt;
&lt;button class="code-copy-btn" title='复制代码' aria-label='复制代码'&gt;
&lt;svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
&gt;
&lt;rect x="9" y="9" width="13" height="13" rx="2" ry="2"&gt;&lt;/rect&gt;
&lt;path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"&gt;&lt;/path&gt;
&lt;/svg&gt;
&lt;/button&gt;
&lt;button class="code-expand-btn" title='折叠代码' aria-label='折叠代码'&gt;
&lt;svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
&gt;
&lt;polyline points="18 15 12 9 6 15"&gt;&lt;/polyline&gt;
&lt;/svg&gt;
&lt;/button&gt;
&lt;div class="code-content-wrapper"&gt;
&lt;div class="code-block-content"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Conv -&amp;gt; BatchNorm -&amp;gt; ReLU -&amp;gt; Conv -&amp;gt; BatchNorm -&amp;gt; ReLU -&amp;gt; MaxPool -&amp;gt; Conv -&amp;gt; BatchNorm -&amp;gt; ReLU -&amp;gt; Conv -&amp;gt; BatchNorm -&amp;gt; ReLU -&amp;gt; Linear.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;CIFAR-10 数据集是一个常用的计算机视觉数据集，包含 60000 张 32x32 彩色图片，分为 10 个类别，每个类别有 6000 张图片。其中 50000 张用于训练，10000 张用于测试。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="实现"&gt;实现&lt;/h2&gt;
&lt;p&gt;整个训练流程将包括以下几个步骤：&lt;/p&gt;</description></item></channel></rss>