Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Train_LM with minimum error step criterium #8

Merged
merged 3 commits into from
Apr 22, 2019

Conversation

mc10011
Copy link
Contributor

@mc10011 mc10011 commented Feb 18, 2019

The proposed changes help in two ways:

  1. Prevent training from running forever when error improves slightly
  2. Stop a training early before k_max is reached if error doesn't improve any more

The proposed changes help in two ways:
1.  Prevent training from running forever when error improves slightly
2. Stop a training early before k_max is reached if error doesn't improve any more
Copy link
Owner

@yabata yabata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribtion. Nice approach!
But would we not want to reset "early" to zero when a step is successfull?

python/pyrenn.py Outdated
if verbose:
print('E-Enew<=min_E_step Encountered!!')
early=early+1
if early>=5.0:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think yo can write this with just one "if verbose" statement

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree.

@mc10011
Copy link
Contributor Author

mc10011 commented Feb 25, 2019

My approach assumes that if a step doesn't improve the Error at least by the min_E_step, then the step is not successful "line 734 if Enew<E and abs(E-Enew)>=min_E_step: ". This way we have the chance to re-adjust the learning rate and get a successful step right after a min_E_step step.

@yabata
Copy link
Owner

yabata commented Mar 2, 2019

My approach assumes that if a step doesn't improve the Error at least by the min_E_step, then the step is not successful "line 734 if Enew<E and abs(E-Enew)>=min_E_step: ". This way we have the chance to re-adjust the learning rate and get a successful step right after a min_E_step step.

Sure, but should the counter "early" not be reset to 0 if there is a successfull step again? Such that it only brekas if this happens 5 times in a row.

@yabata yabata closed this Mar 2, 2019
@yabata yabata reopened this Mar 2, 2019
Refine early stopping criterium for resetting when a step is successful and verbose is chosen
deleted a redundant comment
@mc10011
Copy link
Contributor Author

mc10011 commented Apr 1, 2019

Changes done.

PS: Since I introduced this early criterium I have never encountered the "infinite-training" problem again

@yabata yabata merged commit 708be9b into yabata:master Apr 22, 2019
@yabata
Copy link
Owner

yabata commented Apr 22, 2019

Thank you for your contribution :)

@mc10011
Copy link
Contributor Author

mc10011 commented Apr 23, 2019 via email

@yabata
Copy link
Owner

yabata commented Apr 23, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants