长江书屋

告密者的下场(第2页)

天才一秒记住【长江书屋】地址:https://www.cjshuwu.com

self.fc=nn.Linear(24*2*2,2)

defforward(self,x):

batchsize=x.size(0)

out=selfonv1(x)

out=self.max_pooling1(out)

out=selfonv2_1(out)

out=selfonv2_2(out)

out=self.max_pooling2(out)

out=out.view(batchsize,-1)

out=self.fc(out)

out=F.log_softmax(out,dim=1)

returnout

classTrainingDataSet(Dataset):

def__init__(self):

super(TrainingDataSet,self).__init__()

self.data_dict_X=X_train

self.data_dict_y=y_train

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)

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)

本章未完,请点击下一章继续阅读!若浏览器显示没有新章节了,请尝试点击右上角↗️或右下角↘️的菜单,退出阅读模式即可,谢谢!

如遇章节错误,请点击报错(无需登陆)


新书推荐

西游记:四川话版漫兽竞技场好男人他有金手指[快穿]替身养猪去了[快穿]枭门邪妻绝世保安赤骨天梯我和大圣是兄弟NBA禁区推土机当反派绑定了女主系统侯门嫡女,相公宠上瘾极品捉妖系统重生之都市邪仙师妹疯癫一笑,对方生死难料神农别闹氪金养美人,我躺着赢麻了万界基因特种岁月(系统)当幸运值为max时全能影后的花式撩法大国工程我的狗狗公司闻名世界抢救大明朝异世界:狼人领主,我靠魅魔发家我的未婚妻是主播