dingo-gw / dingo

Dingo: Deep inference for gravitational-wave observations
MIT License
55 stars 18 forks source link

Replace chainconsumer with corner #169

Closed stephengreen closed 1 year ago

stephengreen commented 1 year ago

This replaces chainconsumer with corner for making corner plot, as described in #166. It places a multiple-posterior corner plotting function in dingo.core.utils.plotting.

I have tested it in dingo_pipe, but not in inference_pipeline.py and diagnostics.py. Could someone who uses these please test it?

nihargupte-ph commented 1 year ago

Nice work, I think it looks reallly good overall! Getting all those corner plots to work must have been hard!

I don't think there is a KDE option for the marginals in corner, but at some point when I used corner I wrote a script to automatically do this. But chainconsumer has this by default. That being said I don't know if it's worth it to do at the moment since we want to start testing on conda-forge ASAP.

stephengreen commented 1 year ago

I actually asked GPT-4 how to fully smooth the 1D marginals, and it wrote a code to plot those axes with seaborn. This seemed excessive; I think we can live with the less smooth ones.

nihargupte-ph commented 1 year ago

If GPT-4 can't do it there's no chance for us :)

I think what I was doing was individually taking the 1d and 2d marginals and training KDEs on them, and then resampling the KDEs. This in general does take a long time to create the plot. But to be honest, I agree the less smooth ones are fine. Maybe something to implement down the line if there is time.

nihargupte-ph commented 1 year ago

Ah also, should we be returnning the figure object? I think it could be quite useful if the user wants to edit the figure or add things on later?

stephengreen commented 1 year ago

Ah also, should we be returnning the figure object? I think it could be quite useful if the user wants to edit the figure or add things on later?

Fine with me. In general I wasn't trying to leave a huge amount of flexibility to the user, but if you think this is useful please go ahead.

nihargupte-ph commented 1 year ago

Ah right, I mean to change that back to how it was before. I can fix it when I'm back to my laptop.