2021
07-22
07-22
pytorch 6 batch_train 批训练操作
看代码吧~importtorchimporttorch.utils.dataasDatatorch.manual_seed(1)#reproducible#BATCH_SIZE=5BATCH_SIZE=8#每次使用8个数据同时传入网路x=torch.linspace(1,10,10)#thisisxdata(torchtensor)y=torch.linspace(10,1,10)#thisisydata(torchtensor)torch_dataset=Data.TensorDataset(x,y)loader=Data.DataLoader(dataset=torch_dataset,#torchTens...
继续阅读 >