随笔分类 -  pytorch的使用

摘要:import torch import torch.nn as nn import torch.autograd as autograd from torch import optim def prepare_sequence(seq,to_ix): idxs = [to_ix[w] for w i 阅读全文
posted @ 2022-08-29 17:24 kuanleung 阅读(6) 评论(0) 推荐(0) 编辑
摘要:import torch import torch.nn as nn import torchvision.datasets as dsets import torchvision.transforms as transforms from torch.autograd import Variabl 阅读全文
posted @ 2022-08-27 21:55 kuanleung 阅读(13) 评论(0) 推荐(0) 编辑
摘要:import torch m = torch.nn.BatchNorm1d(10) m = torch.nn.BatchNorm1d(10,affine=False) input = torch.autograd.Variable(torch.randn(20,10)) output = m(inp 阅读全文
posted @ 2022-08-27 14:58 kuanleung 阅读(31) 评论(0) 推荐(0) 编辑
摘要:import torch import torch.utils.data as Data import torch.nn.functional as F from torch.autograd import Variable import matplotlib.pyplot as plt impor 阅读全文
posted @ 2022-08-26 20:46 kuanleung 阅读(13) 评论(0) 推荐(0) 编辑
摘要:根据课程手写代码,归纳总结笔记 #导入包 import torch import matplotlib.pyplot as plt import torch.nn.functional as F from sklearn.datasets import load_iris from torch.au 阅读全文
posted @ 2022-08-22 15:24 kuanleung 阅读(6) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示