Example #1
0
    def __init__(self, pretrained_word_embeddings, gpu_utils, opt):
        super(DCNNATT, self).__init__(pretrained_word_embeddings, gpu_utils, opt)

        self.embedding_layer = Embedding(pretrained_word_embeddings, opt)
        self.encoder_layer = gpu_utils.module_to_parallel(DcnnEncoder(opt))
        self.selector_layer = Attention(opt.hidden_size, opt)
        self.classifier_layer = Classifier(opt)
Example #2
0
    def __init__(self, pretrained_word_embeddings, gpu_utils, opt):
        super(PDCNNTATT, self).__init__(pretrained_word_embeddings, gpu_utils, opt)

        self.beta = opt.beta

        self.embedding_layer = Embedding(pretrained_word_embeddings, opt)
        self.encoder_layer = gpu_utils.module_to_parallel(PDcnnEncoder(opt))
        self.selector_layer = TypeAttention(opt.hidden_size * 3, gpu_utils.use_gpu, opt)
        self.classifier_layer = Classifier(opt)