随笔分类 - 深度学习
module
摘要:import torchfrom torch import nnfrom torch import optim#优化器类# 1. torch.optim.SGD(参数,学习率)# 2. torch.optim.Adam(参数,学习率)import numpy as npfrom matplotlib
阅读全文
train_data
摘要:for images, labels in train_data: for images, labels in train_data: img = images[0] img = img.numpy() img = np.transpose(img, (1, 2, 0)) plt.imshow(im
阅读全文
损失函数
摘要:import torchimport torch.nn as nninput = torch.randn(3, 3)#print(input)sm = nn.Softmax(dim=1)sl = nn.LogSoftmax(dim=1)#print(sm(input))test1 = torch.l
阅读全文
浙公网安备 33010602011771号