(self, input_thumb, input_L)
| 46 | self.linear2 = nn.Sequential(torch.nn.Linear(self.emb_dim, fea_dim),torch.nn.ReLU()) |
| 47 | |
| 48 | def forward(self, input_thumb, input_L): |
| 49 | input_ALL = torch.cat((input_L, input_thumb),1) #(bs,len+1,4096) |
| 50 | fea_A = torch.bmm(input_thumb,self.linear1(input_ALL).permute(0,2,1)) # (bs, 1, len+1) |
| 51 | fea_alpha = F.softmax(fea_A) # (bs, 1, len+1) |
| 52 | fea_V = torch.matmul(fea_alpha,input_ALL).squeeze() # (bs, 4096) |
| 53 | fea = self.linear2(fea_V) |
| 54 | return fea |
| 55 | |
| 56 | class ReverseLayerF(Function): |
| 57 | #@staticmethod |
nothing calls this directly
no outgoing calls
no test coverage detected