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

Method __init__

code/models/Baselines.py:111–122  ·  view source on GitHub ↗
(self, fea_dim, vocab_size)

Source from the content-addressed store, hash-verified

109
110class bTextCNN(nn.Module):
111 def __init__(self, fea_dim, vocab_size):
112 super(bTextCNN, self).__init__()
113 self.vocab_size = vocab_size
114 self.fea_dim=fea_dim
115
116 self.channel_in = 1
117 self.filter_num = 14
118 self.window_size = [3,4,5]
119
120 self.textcnn =nn.ModuleList([nn.Conv2d(self.channel_in, self.filter_num, (K,self.vocab_size)) for K in self.window_size])
121 self.linear = nn.Sequential(torch.nn.Linear(len(self.window_size) * self.filter_num, self.fea_dim),torch.nn.ReLU())
122 self.classifier = nn.Linear(self.fea_dim,2)
123
124 def forward(self, **kwargs):
125 title_w2v = kwargs['title_w2v']

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected