MCPcopy Create free account
hub / github.com/NJUNLP/GTS / __init__

Method __init__

code/BertModel/model.py:8–17  ·  view source on GitHub ↗
(self, args)

Source from the content-addressed store, hash-verified

6
7class MultiInferBert(torch.nn.Module):
8 def __init__(self, args):
9 super(MultiInferBert, self).__init__()
10
11 self.args = args
12 self.bert = BertModel.from_pretrained(args.bert_model_path)
13 self.tokenizer = BertTokenizer.from_pretrained(args.bert_tokenizer_path)
14
15 self.cls_linear = torch.nn.Linear(args.bert_feature_dim*2, args.class_num)
16 self.feature_linear = torch.nn.Linear(args.bert_feature_dim*2 + args.class_num*3, args.bert_feature_dim*2)
17 self.dropout_output = torch.nn.Dropout(0.1)
18
19 def multi_hops(self, features, mask, k):
20 '''generate mask'''

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected