Skip to content

Commit

Permalink
debugged
Browse files Browse the repository at this point in the history
  • Loading branch information
LiyuanLucasLiu committed Sep 14, 2017
1 parent 48f02eb commit 8953317
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions model/crf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,9 @@ class CRF_L(nn.Module):
This CRF layer is used in Ma et al. 2016, has more parameters than CRF_S
arg:
hidden_dim : input dim size
tagset_size: target_set_size
if_biase: whether allow bias in linear trans
inpug:
- **feats** (batch_size, seq_len, hidden_dim) : input score from previous layers
output:
- **crf_score** (batch_size, seq_len, tag_size, tag_size) : output from crf layer
hidden_dim : input dim size |
tagset_size: target_set_size
|if_biase: whether allow bias in linear trans
"""


Expand All @@ -43,6 +36,13 @@ def rand_init(self):
utils.init_linear(self.hidden2tag)

def forward(self, feats):
"""
inpug:
- **feats** (batch_size, seq_len, hidden_dim) : input score from previous layers
output:
- **crf_score** (batch_size, seq_len, tag_size, tag_size) : output from crf layer
"""
return self.hidden2tag(feats).view(-1, self.tagset_size, self.tagset_size)


Expand Down

0 comments on commit 8953317

Please sign in to comment.