def __call__(self, x, train=True):
h_x = self.embed(x)
n_words = h_x.shape[1]
h_x = F.expand_dims(h_x, 1)
h_x = F.relu(self.bnorm1(self.cnn1(h_x)))
h_x = F.max_pooling_2d(h_x, (n_words, self.__vec_size))
h_x = F.relu(self.l1(h_x))
return self.l2(h_x)
评论列表
文章目录