Feature/issue 62 visualisation - #269
Conversation
| """ | ||
| num_samples, num_mesh_nodes, latent_dim = prior_samples.shape | ||
| plot_dims = min(latent_dim, 3) | ||
| img_side_size = int(np.sqrt(num_mesh_nodes)) |
There was a problem hiding this comment.
plot_latent_samples() seems to assume the latent mesh can always be reshaped into a square image via sqrt(num_mesh_nodes). That works for image-like lattices, but for the graph meshes used by the probabilistic models this is not generally true. In those cases this will either fail on the reshape or silently misrepresent the latent field.
Since this PR is for the #62 visualization path, I think this needs either:
- an explicit guard that this helper only supports square regular-grid layouts, or
- a plotting path that uses actual mesh/grid coordinates instead of
sqrt(N) x sqrt(N)reshaping.
|
Hi, a few high-level points here that you can look at before I give a more detailed review:
|
cbb774c to
b339f68
Compare
|
Closing this one. The visualisation work here is now covered by #612, which ports |
Describe your changes
Ensemble Plots: Added plot_ensemble_prediction to visualize ground truth, ensemble mean, spread, and individual members.
Latent Inspection: Added plot_latent_samples to compare prior and variational distributions for Graph-EFM latent space.
Modular Refactoring: Switched all functions to the BaseRegularGridDatastore api to ensure compatibility across different regional grids.
Bug Fixes: Resolved a memory leak in plot_spatial_error using .detach() and fixed an alpha-channel dimension mismatch
Motivation
These changes are required to support the transition to probabilistic modeling (Issue #62). By moving these into vis.py we keep the main model classes decoupled from visualization logic.
Dependencies
pytorch, matplotlib, cartopy, and the updated datastore module.
Issue link
#62
Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee