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

Saving the plots as a gif or a video #22

Open
binarycache opened this issue Feb 19, 2022 · 2 comments
Open

Saving the plots as a gif or a video #22

binarycache opened this issue Feb 19, 2022 · 2 comments
Assignees
Labels

Comments

@binarycache
Copy link

Can you please add saving the plots as a gif or a video as it will make it easier to just take a look and understand things once the training ends?

@fsschneider
Copy link
Collaborator

Hi,

you could take a look at our experiment repository, which contains all the code to re-create the experiments shown in the paper, including the animated showcase.

More specifically, the method animate might be what you are looking for:

https://github.com/fsschneider/cockpit-experiments/blob/a9eaf3dc5da5a58356ac0eef25a11235bf0891c4/experiments/10_showcase/shared.py#L99-L139

It lets you build and save an animation from the logged .json file.

@f-dangel and I can discuss if and how this is a functionality we want to integrate into the main cockpit library.

For now, I hope that this code snippet is helpful for you to create the gifs that you want.
Let me know if that works for you.

@binarycache
Copy link
Author

Hi @fsschneider,

Thank you for the reply. I managed to use the animate function and generate the corresponding gif.

In the process, I found that the plotter class already has a function called build_animation() here

However, I think this function calls _animate() and the pattern used in the animate function perhaps needs some modifications. For example pattern = os.path.splitext(logpath)[0] + f"__{screen}epoch*.png"

I think here it should be {epoch} instead of hardcoded epoch because of the way the plot function saves the data. Similarly, you have to tweak the path returned from get_logpath() a bit to make it work. I think it would be easier if we can directly use get_logpath().

Thanks Again.
Best,
Anmol

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

No branches or pull requests

2 participants