示例#1
0
 def __call__(self, x):
     h = self.embed(x)
     h = h.transpose(0, 2, 1)
     h = self.conv1(h)
     h = self.cb2(h)
     h = F.max_pooling_nd(h, 3, 2, 1, cover_all=False)
     h = self.cb3(h)
     h = F.max_pooling_nd(h, 3, 2, 1, cover_all=False)
     h = self.cb4(h)
     h = F.max_pooling_nd(h, 3, 2, 1, cover_all=False)
     h = self.cb5(h)
     h = k_max_pooling_1d(h, 8)
     h = F.relu(self.fc6(h))
     h = F.relu(self.fc7(h))
     h = self.fc8(h)
     return h
示例#2
0
 def __call__(self, x):
     h = self.embed(x)
     h = h.transpose(0, 2, 1)
     h = self.conv1(h)
     h = self.cb2(h)
     h = F.max_pooling_nd(h, 3, 2, 1, cover_all=False)
     h = self.cb3(h)
     h = F.max_pooling_nd(h, 3, 2, 1, cover_all=False)
     h = self.cb4(h)
     h = F.max_pooling_nd(h, 3, 2, 1, cover_all=False)
     h = self.cb5(h)
     h = k_max_pooling_1d(h, 8)
     h = F.relu(self.fc6(h))
     h = F.relu(self.fc7(h))
     o1 = self.fc8_1(h)
     o2 = self.fc8_2(h)
     o3 = self.fc8_3(h)
     out = F.concat([o1, o2, o3], axis=1)
     return out