def forward(self, x):
batchSize = x.size()[0]
x1 = torch.zeros(batchSize, 1, 1, 21)
x2 = torch.zeros(batchSize, 1, 1, 21)
x3 = torch.zeros(batchSize, 1, 1, 21)
for b in range(batchSize):
for t in range(21):
x1[b,0,0,t] = x.data[b,0,0,t]
x2[b,0,0,t] = x.data[b,0,1,t]
x3[b,0,0,t] = x.data[b,0,2,t]
x1, x2, x3 = Variable(x1), Variable(x2), Variable(x3)
x1, x2, x3 = self.br1.forward(x1), self.br2.forward(x2), self.br2.forward(x3)
x = torch.cat([x1, x2, x3], 1)
x = self.bn1(x)
x = F.dropout(x, p=self.dropout)
x = self.fc1(x)
x = self.bn2(x)
x = F.dropout(x, p=self.dropout)
x = self.fc2(x)
return x
评论列表
文章目录