Skip to content

Commit

Permalink
upload_Nezha
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengyanzhao committed Apr 26, 2021
1 parent 7db6145 commit e6795be
Show file tree
Hide file tree
Showing 37 changed files with 280 additions and 2,479 deletions.
2,298 changes: 0 additions & 2,298 deletions model/model/NEZHA/data_proceed.ipynb

This file was deleted.

174 changes: 0 additions & 174 deletions model/model/NEZHA/generate_Seqdata.ipynb

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,10 @@ def __init__(self,model_path):
nn.Linear(512, 2)
)
self.standerembed = nn.Embedding(6,128)
#self.lengthembed = nn.Embedding(3,32)
self.bert = BertModel.from_pretrained(model_path,config=Config)

def forward(self, input_ids, attention_mask,token_type_ids,c):
conditional = self.standerembed(c)
#lengthembed = self.lengthembed(length)
#conditional = torch.cat([standerembed,lengthembed],-1)
x1 = self.bert(input_ids, attention_mask=attention_mask,token_type_ids=token_type_ids,conditional=conditional)
x2 = x1.last_hidden_state
logits = self.linear_relu_stack(x2[:, 0])
Expand Down
Loading

0 comments on commit e6795be

Please sign in to comment.