Browse Source

当activation=lambda x: x出现错误 (#330)

Co-authored-by: 路人咦 <1417954729@qq.com>
tags/v0.6.0
w.g GitHub 4 years ago
parent
commit
81bcb51314
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      fastNLP/modules/decoder/mlp.py

+ 2
- 2
fastNLP/modules/decoder/mlp.py View File

@@ -71,8 +71,8 @@ class MLP(nn.Module):
f"the length of activation function list except {len(size_layer) - 2} but got {len(activation)}!") f"the length of activation function list except {len(size_layer) - 2} but got {len(activation)}!")
self.hidden_active = [] self.hidden_active = []
for func in activation: for func in activation:
if callable(activation):
self.hidden_active.append(activation)
if callable(func):
self.hidden_active.append(func)
elif func.lower() in actives: elif func.lower() in actives:
self.hidden_active.append(actives[func]) self.hidden_active.append(actives[func])
else: else:


Loading…
Cancel
Save