-
Notifications
You must be signed in to change notification settings - Fork 7
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
[WIP] Visualize the latent space from the auto encoder #245
base: master
Are you sure you want to change the base?
Conversation
This reverts commit 448043b.
Hello @levje, Thank you for updating !
Comment last updated at 2024-09-27 17:23:21 UTC |
Should probably be merged AFTER that PR: #220
Description
It was asked to be able to visualize the latent space based on #220 w.r.t to FINTA from Legarreta et al (2021). As in the original paper, we are projecting the latent space coming out of the auto-encoder into 2D using t-SNE which preserves a smaller distance for similar streamlines and a higher distance for different streamlines.
The class latent_streamlines.py:BundlesLatentSpaceVisualizer is the bulk of the changes done and was made to potentially be reused for other data that needs to be projected and plotted in 2D. I was also asked to be able to visualize the latent space each n epochs during the training. ae_train_model.py holds the code that was added to be able to do that. However, that's probably not the cleanest implementation I could've done for that. For a cleaner implementation, I would've needed the trainer to have more hooks (e.g. at the end of each epoch, I would have a function that would get called to plot the accumulated data and call reset_data()) or simply implement it. And I didn't want to touch the trainer class too much simply for a use-case I thought to be unique and probably won't be useful for other projects.
(Although having a future PR adding hooks everywhere in the trainer/models in a similar fashion to LightningAI or PyTorch.nn.Module add more flexibility to the library in my opinion!)
Scripts:
--viz_latent_space_freq
.[WIP] One feature that might be missing is that if we have the indices of the bundles of the data to be added, we could assign it to their labels directly instead of needing to call add_data_to_plot several times.
Testing data and script
Have you
People this PR concerns
@arnaudbore @AntoineTheb