Skip to content

Commit 30482b3

Browse files
author
Han Wang
committed
fix bug of getting loss_type from None loss_param
1 parent e8bbee4 commit 30482b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/train/Trainer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,10 @@ def _init_param(self, jdata):
144144
# infer loss type by fitting_type
145145
try :
146146
loss_param = jdata['loss']
147+
loss_type = loss_param.get('type', 'std')
147148
except:
148149
loss_param = None
149-
loss_type = loss_param.get('type', 'std')
150+
loss_type = 'std'
150151

151152
if fitting_type == 'ener':
152153
if loss_type == 'std':

0 commit comments

Comments
 (0)