擅长:python、mysql、java
<p>它是输入中的通道数。在MNIST数据集中,图像为灰度,因此图像的形状为<code>[28, 28, 1]</code>。请注意,pytorch将第一个维度设置为通道维度</p>
<p>当然,一旦作为批加载,总输入形状就是您得到的形状</p>
<p>请参阅<a href="http://yann.lecun.com/exdb/mnist/" rel="nofollow noreferrer">MNIST dataset</a>链接,其中指出:</p>
<blockquote>
<p>The original black and white (bilevel) images from NIST were size
normalized to fit in a 20x20 pixel box while preserving their aspect
ratio. The resulting images contain grey levels as a result of the
anti-aliasing technique used by the normalization algorithm. the
images were centered in a 28x28 image by computing the center of mass
of the pixels, and translating the image so as to position this point
at the center of the 28x28 field.</p>
</blockquote>