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.
这将表明数据集中存在的批次数。把它想象成一组,我们有一批64张图片,或者你可以改变它,比如说,每个有两批32张图片。批量大小通常会影响模型的计算复杂性。 当然,根据所使用的库(特别是在培训/测试循环中),如果只使用1批或X批,代码看起来会略有不同
例如(历元数/迭代次数=50):假设您正在训练批量大小为1的数据集,在训练循环中,您只需编写训练模型历元时间。但是,对于batch size=x,您必须为每个历元以及每个批次/组循环
简而言之,
这只是你的
28x28
图像的通道数它是输入中的通道数。在MNIST数据集中,图像为灰度,因此图像的形状为
[28, 28, 1]
。请注意,pytorch将第一个维度设置为通道维度当然,一旦作为批加载,总输入形状就是您得到的形状
请参阅MNIST dataset链接,其中指出:
相关问题 更多 >
编程相关推荐