Skip to content

Commit c12ade6

Browse files
committed
fix: hashnet not update beta params
1 parent 6ff37f7 commit c12ade6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/train_general.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ def pre_epoch_operations(loss, **kwargs):
118118
ep = kwargs['ep']
119119
loss_param = kwargs['loss_param']
120120
step_continuation = loss_param['loss_param']['step_continuation']
121-
loss_param['loss_param']['beta'] = (ep // step_continuation + 1) ** 0.5
122-
logging.info(f'updated scale: {loss_param["loss_param"]["beta"]}')
121+
kwargs['criterion'].beta = (ep // step_continuation + 1) ** 0.5
122+
logging.info(f'updated scale: {kwargs["criterion"].beta}')
123123

124124

125125
def train_hashing(optimizer, model, train_loader, device, loss_name, loss_cfg, onehot,

0 commit comments

Comments
 (0)