MCPcopy Create free account
hub / github.com/ICTMCG/FakeSV / __init__

Method __init__

code/models/FANVM.py:71–86  ·  view source on GitHub ↗
(self,bert_model,fea_dim)

Source from the content-addressed store, hash-verified

69
70class FANVMModel(torch.nn.Module):
71 def __init__(self,bert_model,fea_dim):
72 super(FANVMModel, self).__init__()
73 self.text_dim = 768
74 self.img_dim = 4096
75 self.topic_dim = 15
76
77 self.bert = BertModel.from_pretrained(bert_model).requires_grad_(False)
78 self.title_encoder = TextCNN(fea_dim, self.text_dim)
79 self.comments_encoder = BiLSTM(self.text_dim,300,fea_dim)
80 self.video_encoder = VideoEncoder(self.img_dim,fea_dim)
81
82 self.gate_m1 = torch.nn.Linear(fea_dim*2,1)
83 self.gate_m2 = torch.nn.Linear(fea_dim*2,1)
84
85 self.classifier = nn.Linear(fea_dim*2,2)
86 self.classifier_topic = nn.Linear(fea_dim*3,self.topic_dim)
87
88 def forward(self, **kwargs):
89 title_inputid = kwargs['title_inputid']#(batch,512)

Callers

nothing calls this directly

Calls 3

TextCNNClass · 0.85
VideoEncoderClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected