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

Method __init__

code/models/FANVM.py:18–28  ·  view source on GitHub ↗
(self, fea_dim, vocab_size)

Source from the content-addressed store, hash-verified

16
17class TextCNN(nn.Module):
18 def __init__(self, fea_dim, vocab_size):
19 super(TextCNN, self).__init__()
20 self.vocab_size = vocab_size
21 self.fea_dim=fea_dim
22
23 self.channel_in = 1
24 self.filter_num = 14
25 self.window_size = [3,4,5]
26
27 self.textcnn =nn.ModuleList([nn.Conv2d(self.channel_in, self.filter_num, (K,self.vocab_size)) for K in self.window_size])
28 self.linear = nn.Sequential(torch.nn.Linear(len(self.window_size) * self.filter_num, self.fea_dim),torch.nn.ReLU())
29
30 def forward(self, inputs):
31 text = inputs.unsqueeze(1)

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected