import torch
import torch.nn as nn
import torchvision
import torchvision.utils as vutils
from torch.optim import SGD
import torch.utils.data as Data
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt
train_data=torchvision.datasets.MNIST(
root="Data",
train=True,
transform=torchvision.transforms.ToTensor(),
download=False,
)
train_loader=Data.DataLoader(
dataset=train_data,
batch_size=128,
shuffle=True,
num_workers=0,
)
test_data=torchvision.datasets.MNIST(
root="Data",
train=False,
download=False,
)
test_data_x=test_data.data.type(torch.FloatTensor)/255.0
test_data_x=torch.unsqueeze<