nnaisense / evotorch

Advanced evolutionary computation library built directly on top of PyTorch, created at NNAISENSE.
https://evotorch.ai
Apache License 2.0
997 stars 62 forks source link

fix: get_minibatch() of SupervisedNE #74

Closed engintoklu closed 1 year ago

engintoklu commented 1 year ago

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.

codecov-commenter commented 1 year ago

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%) :arrow_down:

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