Skip to content

Commit

Permalink
Update training_multiSample.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yiwang12 authored Oct 3, 2024
1 parent fafe52c commit 1c2a75b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mNSF/training_multiSample.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ def _train_model_fixed_lr(self, list_tro,list_Dtrain, list_D__, ckpt_mgr,Dval=No
else: cvg=0
if test_cvdNorm:
rel_chg_normalized=cc.relative_chg_normalized(self.loss["train"],idx_current=i)
print("rel_chg_normalized")
print(rel_chg_normalized)
if(-(rel_chg_normalized)<tol_norm): cvg_normalized+=1 # positive values of rel_chg_normalized indicates increase of loss throughout the past 10 iterations
if(-(rel_chg_normalized)<tol_norm): cvg_normalized+=1 # positive values of rel_chg_normalized indicates increase of loss throughout the past 10 iterations
if cvg>=2 or cvg_normalized>=2: #i.e. either convergence or normalized convergence has been detected twice in a row
self.converged=True
pickle_freq = i #ensures final pickling will happen
Expand Down

0 comments on commit 1c2a75b

Please sign in to comment.