aimclub / GOLEM

Graph Optimiser for Learning and Evolution of Models
https://thegolem.readthedocs.io
BSD 3-Clause "New" or "Revised" License
60 stars 7 forks source link

Add tuning history to OptHistory #228

Open MorrisNein opened 11 months ago

MorrisNein commented 11 months ago

Adds an option to save graph to OptHistory after each objective evaluation in the process of tuning (Solves #226).

Allows tuners to work with Individual and Fitness for graphs comparison & history saving.

Changes OptHistory fields:

Allows histories backward compatibility.

Fixes previously unknown bug with multi objective tuning.

aim-pep8-bot commented 11 months ago

Hello @MorrisNein! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers:

Comment last updated at 2023-11-04 12:07:43 UTC
pep8speaks commented 11 months ago

Hello @MorrisNein! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 38:25: E131 continuation line unaligned for hanging indent

Comment last updated at 2023-11-04 12:07:51 UTC
codecov-commenter commented 11 months ago

Codecov Report

Merging #228 (02e3ecd) into main (29cd362) will increase coverage by 0.13%. Report is 3 commits behind head on main. The diff coverage is 92.66%.

@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
+ Coverage   72.16%   72.29%   +0.13%     
==========================================
  Files         135      136       +1     
  Lines        8061     8184     +123     
==========================================
+ Hits         5817     5917     +100     
- Misses       2244     2267      +23     
Files Coverage Δ
golem/core/optimisers/genetic/gp_optimizer.py 98.80% <100.00%> (+0.01%) :arrow_up:
...core/optimisers/opt_history_objects/opt_history.py 76.37% <100.00%> (+0.79%) :arrow_up:
golem/core/optimisers/populational_optimizer.py 95.74% <100.00%> (+0.04%) :arrow_up:
golem/core/tuning/hyperopt_tuner.py 97.61% <100.00%> (+0.05%) :arrow_up:
golem/core/tuning/iopt_tuner.py 100.00% <100.00%> (ø)
golem/core/tuning/optuna_tuner.py 93.10% <100.00%> (+0.08%) :arrow_up:
golem/core/tuning/sequential.py 95.45% <100.00%> (+0.06%) :arrow_up:
golem/core/tuning/simultaneous.py 90.14% <100.00%> (+2.81%) :arrow_up:
...em/serializers/coders/opt_history_serialization.py 98.76% <100.00%> (+0.03%) :arrow_up:
...em/visualisation/opt_history/graphs_interactive.py 0.00% <ø> (ø)
... and 6 more

... and 21 files with indirect coverage changes

MorrisNein commented 11 months ago

Добавил в тюнеры работу с классами истории оптимизации, раз уж теперь они могут сохранять в неё результаты.

Сравнение графов между собой, на мой взгляд, стало удобнее, особенно для MultiObjFitness: не нужно перегонять метрики в класс MultiObjFitness и обратно.

nicl-nno commented 10 months ago

Хорошо бы в одном из примеров показать как использовать новую фунциональность. У @YamLyubov был пример с раскраской графа, например.