pytorch-Mnist教程
https://pytorch-cn.readthedocs.io/zh/latest/package_references/torch/#blas-and-lapack-operations
https://github.com/pytorch/examples/blob/master/mnist/main.py
资源的两个链接:第一个是中文文档,第二个是github上的学习教程,挺不错的。
一、首先加载库
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets,transforms
二、定义训练参数
parser = argparse.ArgumentParser()
parser.add_argument('--batch_size',type=int,default=64)
parser.add_argument('--test-batch_