Skip to content

Commit

Permalink
Refine early stopping criterium
Browse files Browse the repository at this point in the history
Refine early stopping criterium for resetting when a step is successful and verbose is chosen
  • Loading branch information
mc10011 authored Apr 1, 2019
1 parent 32a6198 commit 8e46bf3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/pyrenn.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,17 @@ def train_LM(P,Y,net,k_max=100,E_stop=1e-10,dampfac=3.0,dampconst=10.0,\
#Optimization Step successful!
#if E-Enew<=1e-09:
dampfac= dampfac/dampconst#adapt scale factor
early=0 #reset the early stopping criterium
break #go to next iteration
else:
#Optimization Step NOT successful!\
dampfac = dampfac*dampconst#adapt scale factor
if abs(E-Enew)<=min_E_step:
early=early+1

if verbose:
print('E-Enew<=min_E_step Encountered!!')
early=early+1
if early>=5.0:
if verbose:
if early>=5.0:
print('5 Times * E-Enew<=min_E_step Encountered!!')
break

Expand Down

0 comments on commit 8e46bf3

Please sign in to comment.