Browse Source

Merge branch 'dev' of github.com:choosewhatulike/fastNLP-private into dev

tags/v0.4.10
yh_cc 5 years ago
parent
commit
62bc898837
3 changed files with 4 additions and 2 deletions
  1. +2
    -1
      fastNLP/core/losses.py
  2. +1
    -0
      fastNLP/modules/decoder/MLP.py
  3. +1
    -1
      reproduction/README.md

+ 2
- 1
fastNLP/core/losses.py View File

@@ -251,7 +251,8 @@ class LossInForward(LossBase):
if not (isinstance(loss, torch.Tensor) and len(loss.size()) == 0):
if not isinstance(loss, torch.Tensor):
raise TypeError(f"Loss excepted to be a torch.Tensor, got {type(loss)}")
raise RuntimeError(f"The size of loss excepts to be torch.Size([]), got {loss.size()}")
loss = torch.sum(loss) / (loss.view(-1)).size(0)
# raise RuntimeError(f"The size of loss excepts to be torch.Size([]), got {loss.size()}")

return loss



+ 1
- 0
fastNLP/modules/decoder/MLP.py View File

@@ -36,6 +36,7 @@ class MLP(nn.Module):
actives = {
'relu': nn.ReLU(),
'tanh': nn.Tanh(),
'sigmoid': nn.Sigmoid(),
}
if not isinstance(activation, list):
activation = [activation] * (len(size_layer) - 2)


+ 1
- 1
reproduction/README.md View File

@@ -8,7 +8,7 @@

## Star-Transformer
[reference](https://arxiv.org/abs/1902.09113)
### Performance
### Performance (still in progress)
|任务| 数据集 | SOTA | 模型表现 |
|------|------| ------| ------|
|Pos Tagging|CTB 9.0|-|ACC 92.31|


Loading…
Cancel
Save