1 Star 2 Fork 0

裴泽宇/Sequential-TCN

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
dataloader.py 748 Bytes
一键复制 编辑 原始数据 按行查看 历史
zhangxin 提交于 2019-03-07 00:04 . MNIST task & P-MNIST task
import torch
from torchvision import datasets,transforms
def data_loader(batch_size):
root='data/'
train_loader=torch.utils.data.DataLoader(
datasets.MNIST(root,train=True,download=True,
transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.1307,),(0.3081,))
])),
batch_size=batch_size,
shuffle=True)
test_loader=torch.utils.data.DataLoader(
datasets.MNIST(root,train=False,download=True,
transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.1307,),(0.3081,))
])),
batch_size=batch_size,
shuffle=True
)
return train_loader,test_loader
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ying_yu_bao/Sequential-TCN.git
git@gitee.com:ying_yu_bao/Sequential-TCN.git
ying_yu_bao
Sequential-TCN
Sequential-TCN
master

搜索帮助