Article directory
data analysis
https://mp.weixin.qq.com/s?__biz=MzIxMTE2NDU0Ng==&mid=2650439629&idx=1&sn=38cac39ed58e9bf6cfd1a7a6312d7114&chksm=8f575320b820da362fd2c38d9acd5f966db84cdd824c3a333bf01e7f042d723db4a79def9262&scene=178&cur_album_id=1763459594401398785#rd
Visualize the results
import matplotlib.pyplot as plt
%matplotlib inline
x = np.arange(len(train_acc_record))
plt.plot(x, train_acc_record, color="blue", label="Train")
plt.plot(x, valid_acc_record, color="red", label="Valid")
plt.legend(loc="upper right")
plt.title("acc")
plt.show()
x = np.arange(len(train_loss_record))
plt.plot(x, train_loss_record, color="blue", label="Train")
plt.plot(x, valid_loss_record, color="red", label="Valid")
plt.legend(loc="upper right")
plt.title("loss")
plt.show()
pytorch outputs the parameters and dimension information of each layer of the network
https://blog.csdn.net/sinat_29957455/article/details/112701029
import torch.nn as nn
from torchsummary import summary
#定义网络结构
net = nn.Sequential(
nn.Conv2d(1,8,kernel_size=7),
nn.MaxPool2d(2,stride=2),
nn.ReLU(True),
nn.Conv2d(8,10,kernel_size=5),
nn.MaxPool2d(2,stride=2),
nn.ReLU(True)
)
#输出每层网络参数信息
summary(net,(1,28,28),batch_size=1,device="cpu")
————————————————
版权声明:本文为CSDN博主「修炼之路」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/sinat_29957455/article/details/112701029