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

Add gif animation of evolution process to README #243

Merged
merged 22 commits into from
Feb 15, 2024

Conversation

donRumata03
Copy link
Collaborator

@donRumata03 donRumata03 commented Nov 28, 2023

Implements #87

Adds visualization of genealogical path of the best found individual suitable for README.
This aims to create stable and evident dynamic of evolving graphs.
The new visualizations are integrated into README files (russian and english versions).

Synthetic evolution is as follows:
evolution_process

Previously, there were these considerations:

  • Is there a way to «stabilize» the change of evolution graph layout in time (to make it closer to the layout of the previous one)? Are archive members with index 0 «stable» enough or should there be a more complicated logic to follow the evolution flow?

    Yes. Just take and track its best parents (or the only parent for mutation) along its genealogy. Ideally, choose the most phenotypically similar parent. archive[0] isn't stable.
    Also, rooted trees are probably more stable in visualization. If that won't be enough, node ids can be tracked and their position can be fixed whereas the others are placed the same way as usual. The obvious potential problem is that some of the node positions can be absolutely irrelevant after some generations, so a gradual shift might be appropriate. Another solution is measuring and pre-allocating enough space to be able to fix the node position from the very moment of its emergence.
    There might be some related work here: https://www2.cs.arizona.edu/~collberg/content/research/papers/collberg03system.pdf

  • Is it enough for the evolution graph to be stable? It is also better kept closer to the target graph (so that the «corresponding» parts would be laid out at similar locations).
  • Should the fitness graph be plotted alongside with the archive members?

    Yes, that sounds useful.

  • Is there supposed to be only one member of the archive or the whole bunch of them (to show that a populational method is applied)?

    Probably not, that's too noisy.

  • Can the animations be made smoother by following mutations and crossovers and visualizing them? That sounds like an overkill…

    Yes, that's an overkill.

  • Clearly, the space allocation for legend and node leaves much to be desired. Either
  • Is it appropriate to place git generation in simple run by default? Or should there be a switch to generate amination, resultant graph or nothing?

    Introduce the option (as an enum?) which is by default just simple image of final result.

  • Should the final result be specially animated? (Longer duration, colorful flash, «congratulations»?…)

Yes, longer duration and green title

  • Should the time of the specified graph being on the screen be proportional to the number of generations before emergence of the child on the genealogical path?

No, the delays would be too chaotic in this case.

@pep8speaks
Copy link

pep8speaks commented Nov 28, 2023

Hello @donRumata03! 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! 🍻

Comment last updated at 2024-02-14 17:02:20 UTC

@codecov-commenter
Copy link

codecov-commenter commented Nov 28, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (a46412c) 71.96% compared to head (8ba6876) 72.40%.
Report is 11 commits behind head on main.

Files Patch % Lines
...lem/visualisation/opt_history/genealogical_path.py 85.71% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #243      +/-   ##
==========================================
+ Coverage   71.96%   72.40%   +0.43%     
==========================================
  Files         136      137       +1     
  Lines        8130     8230     +100     
==========================================
+ Hits         5851     5959     +108     
+ Misses       2279     2271       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@donRumata03 donRumata03 marked this pull request as draft November 28, 2023 09:23
@nicl-nno
Copy link
Collaborator

Правой части анимации явно требуется № текущего поколения, общее число поколений и значение целевой функции. Чтобы было понятно, сколько ждать. Но вроде в visualise_history это есть (если нет - можно добавить)

@donRumata03 donRumata03 marked this pull request as ready for review January 30, 2024 14:17
@donRumata03
Copy link
Collaborator Author

Остаётся вопрос, стоит ли добавлять эту визализацию в основные (доступные через show). Говорят, @MorrisNein должен знать.

С одной стороны — это красивая и наглядная демонстрация, но не исчерпывающая (просто показывает один из мноих путей эволюции)

@nicl-nno nicl-nno requested a review from Nunkyl January 30, 2024 15:40
@nicl-nno
Copy link
Collaborator

Остаётся вопрос, стоит ли добавлять эту визализацию в основные (доступные через show

Какой-то удобный способ её получать в любом случае не помешает.

README.rst Outdated Show resolved Hide resolved
golem/visualisation/opt_viz_extra.py Outdated Show resolved Hide resolved
golem/visualisation/opt_viz_extra.py Show resolved Hide resolved
README.rst Outdated Show resolved Hide resolved
@donRumata03
Copy link
Collaborator Author

Остаётся вопрос, стоит ли добавлять эту визализацию в основные (доступные через show

Какой-то удобный способ её получать в любом случае не помешает.

Знаю ровно один способ: добавить в реестр визуализаций, доступных через OptHistory.show(...).
Добавил + отразил это в тестах визуализации.

@donRumata03 donRumata03 requested a review from Nunkyl February 13, 2024 19:35
@donRumata03
Copy link
Collaborator Author

@pep8speaks suggest diff

@donRumata03
Copy link
Collaborator Author

/fix-pep8

@nicl-nno
Copy link
Collaborator

Можешь мержить.

@donRumata03 donRumata03 merged commit 68706be into main Feb 15, 2024
6 checks passed
@donRumata03 donRumata03 deleted the 87-readme-gif-animation branch February 15, 2024 12:59
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.

5 participants