deepsphere / deepsphere-cosmo-tf1

A spherical convolutional neural network for cosmology (TFv1).
https://arxiv.org/abs/1810.12186
MIT License
131 stars 30 forks source link

[WIP] Visualization and introspection #13

Closed mdeff closed 6 years ago

mdeff commented 6 years ago

Goal: visualize to introspect the model and understand what it learned to pick up.

Previously discussed in #8

mdeff commented 6 years ago

Note: this branch has been rebased on master to gain the data loader. Moreover, notebooks were cleaned of their outputs. Please delete your local branch before pulling again.

nperraud commented 6 years ago

Thanks for your work. Do you want me to integrate my two visualization functions into a small module 'visualisation.py'?

mdeff commented 6 years ago

I'm doing that as I go along. :)

mdeff commented 6 years ago

Note: the code needs the development version of the PyGSP available in the polynomial-approximations branch. I will release version 0.6.0 of the package before we make this repository public.

mdeff commented 6 years ago

@nperraud: when plotting filters for the part_sphere experiments, I've noticed that utils.healpix_graph(nside=nside) takes a very long time when e.g. nside=1024. Is there a faster way to do it, e.g. by optimizing that function? Or can we plot filters without having to build the complete graph?

nperraud commented 6 years ago

On simple fix is to plot the filter in the graph corresponding to the part of the sphere. But then the graph filter shape will depend on the choice of the node.

I think we should do that (why plotting the filter on the wrong graph?). However, this raise the question of how to handle border effects...

I will work on scnn the full day tomorrow so we can be efficient on Thursday.

mdeff commented 6 years ago

If we choose a sufficiently large part of sphere (that is the diameter is larger than two times the polynomial order), then we should not have any border effect right?

I'll work on another project tomorrow (I worked on scnn the whole yesterday and today already). So I'll look into ways to optimize those functions this evening (we need them to compute the Laplacian as well). Then tomorrow you can look into ways to plot on the part of sphere only. :)

mdeff commented 6 years ago

I've fixed the slow utils.healpix_weightmatrix() issue in d290e32. It's now ~25 times faster for the whole sphere and ~50 times faster with indexes.

The issue now is that utils.plot_filters_section() is very slow.

mdeff commented 6 years ago

We can now visualize the learned filters for all our experiments. :) @nperraud please take a look and merge this so that you can base your work on it tomorrow.