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

fix: get_minibatch() of SupervisedNE #74

Merged
merged 1 commit into from
Mar 29, 2023
Merged

Conversation

engintoklu
Copy link
Collaborator

This pull request fixes/improves SupervisedNE in two ways:

1)
The get_minibatch() method of SupervisedNE no longer uses recursion to handle the end of the data loader's minibatches. The new implementation catches only StopIteration and non-recursively restarts the iterator of the data loader. Any other type of error is now deliberately unhandled to avoid unwanted infinite recursion and to allow the user to see the details of the error.

2)
The example notebook Training_MNIST30K.ipynb demonstrating the usage of SupervisedNE is updated so that its hyperparameter configuration follows what is reported in the technical report of EvoTorch. This way, results reported in the report can be reproduced.

This commit fixes/improves SupervisedNE in two
ways:

1)
The `get_minibatch()` method of `SupervisedNE`
no longer uses recursion to handle the end of
the data loader's minibatches. The new
implementation catches only `StopIteration`
and non-recursively restarts the iterator of the
data loader. Any other type of error is now
deliberately unhandled to avoid unwanted
infinite recursion and to allow the user to see
the details of the error.

2)
The example notebook `Training_MNIST30K.ipynb`
demonstrating the usage of `SupervisedNE` is
updated so that its hyperparameter configuration
follows what is reported in the technical report
of EvoTorch. This way, results reported in the
report can be reproduced.

Co-authored-by: Timothy Atkinson <timothy@nnaisense.com>
Co-authored-by: Nihat Engin Toklu <engin@nnaisense.com>
@codecov-commenter
Copy link

Codecov Report

Merging #74 (8078df0) into master (e8060ff) will decrease coverage by 0.03%.
The diff coverage is 62.50%.

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
- Coverage   77.85%   77.83%   -0.03%     
==========================================
  Files          49       49              
  Lines        7330     7332       +2     
==========================================
  Hits         5707     5707              
- Misses       1623     1625       +2     
Impacted Files Coverage Δ
src/evotorch/neuroevolution/supervisedne.py 87.69% <62.50%> (-2.79%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@NaturalGradient NaturalGradient left a comment

Choose a reason for hiding this comment

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

Looks good!

@engintoklu engintoklu merged commit ca86228 into master Mar 29, 2023
@engintoklu engintoklu deleted the fix/supervisedne branch March 29, 2023 17:22
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.

3 participants