model/paper_conv.py [50:77]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.fc = nn.Sequential(
            nn.Linear(64, self.drep),
            nn.Tanh(),
        )

    def encode_wiki(self, inputs):
        T, B, wiki_len = inputs['wiki'].size()
        if self.disable_wiki:
            return torch.Tensor(T, B, 2*self.drnn).zero_().to(inputs['wiki'].device)
        else:
            x = inputs['wiki'].view(-1, wiki_len).long()
            xlens = inputs['wiki_len'].view(-1)
            return self.run_rnn_selfattn(self.wiki_rnn, x, xlens, self.wiki_scorer)

    def encode_inv(self, inputs):
        T, B, max_len = inputs['inv'].size()
        x = inputs['inv'].view(-1, max_len).long()
        xlens = inputs['inv_len'].view(-1)
        return self.run_rnn_selfattn(self.inv_rnn, x, xlens, self.inv_scorer)

    def encode_task(self, inputs):
        T, B, max_len = inputs['task'].size()
        x = inputs['task'].view(-1, max_len).long()
        xlens = inputs['task_len'].view(-1)
        return self.run_rnn_selfattn(self.task_rnn, x, xlens, self.task_scorer)

    def fuse(self, inputs, cell, inv, wiki, task):
        T, B, H, W, demb = cell.size()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



model/paper_film.py [62:89]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.fc = nn.Sequential(
            nn.Linear(64, self.drep),
            nn.Tanh(),
        )

    def encode_wiki(self, inputs):
        T, B, wiki_len = inputs['wiki'].size()
        if self.disable_wiki:
            return torch.Tensor(T, B, 2*self.drnn).zero_().to(inputs['wiki'].device)
        else:
            x = inputs['wiki'].view(-1, wiki_len).long()
            xlens = inputs['wiki_len'].view(-1)
            return self.run_rnn_selfattn(self.wiki_rnn, x, xlens, self.wiki_scorer)

    def encode_inv(self, inputs):
        T, B, max_len = inputs['inv'].size()
        x = inputs['inv'].view(-1, max_len).long()
        xlens = inputs['inv_len'].view(-1)
        return self.run_rnn_selfattn(self.inv_rnn, x, xlens, self.inv_scorer)

    def encode_task(self, inputs):
        T, B, max_len = inputs['task'].size()
        x = inputs['task'].view(-1, max_len).long()
        xlens = inputs['task_len'].view(-1)
        return self.run_rnn_selfattn(self.task_rnn, x, xlens, self.task_scorer)

    def fuse(self, inputs, cell, inv, wiki, task):
        T, B, H, W, demb = cell.size()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



