fixed the parameter transfer problem for criterion (#75)

* fixed the parameter transfer problem for criterion

Co-authored-by: yangyyt <yuntingyang@yuntingdeMacBook-Pro.local>
This commit is contained in:
Wall.E 2022-07-13 23:50:48 +08:00 committed by GitHub
parent 141d40704f
commit 51f0fe6dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,8 @@ class Executor:
continue
logits = model(feats)
loss_type = args.get('criterion', 'max_pooling')
loss, acc = criterion(loss_type, logits, target, feats_lengths)
loss, acc = criterion(loss_type, logits, target, feats_lengths,
min_duration)
optimizer.zero_grad()
loss.backward()
grad_norm = clip_grad_norm_(model.parameters(), clip)