X[index,0:36]
t=torch.tensor(t).view(6,6)
returnt,self.data_dict_y[index]
def__len__(self):
returnlen(self.data_dict_y)
classTestDataSet(Dataset):
def__init__(self):
super(TestDataSet,self).__init__()
self.data_dict_X=X_validate
self.data_dict_y=y_validate
def__getitem__(self,index):
t=self.data_dict_X[index,0:36]
t=torch.tensor(t).view(6,6)
returnt,self.data_dict_y[index]
def__len__(self):
returnlen(self.data_dict_y)
defcnn_classification():
batch_size=256
trainDataLoader=DataLoader(TrainingDataSet(),batch_size=batch_size,shuffle=False)
testDataLoader=DataLoader(TestDataSet(),batch_size=batch_size,shuffle=False)
epoch_num=200
#lr=0.001
lr=0.001
net=VGGBaseSimpleS2().to(device)
print(net)
#loss
loss_func=
本章未完,请点击下一页继续阅读! 第3页 / 共10页