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:
parent
141d40704f
commit
51f0fe6dc3
@ -45,7 +45,8 @@ class Executor:
|
|||||||
continue
|
continue
|
||||||
logits = model(feats)
|
logits = model(feats)
|
||||||
loss_type = args.get('criterion', 'max_pooling')
|
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()
|
optimizer.zero_grad()
|
||||||
loss.backward()
|
loss.backward()
|
||||||
grad_norm = clip_grad_norm_(model.parameters(), clip)
|
grad_norm = clip_grad_norm_(model.parameters(), clip)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user