pints-team / pints

Probabilistic Inference on Noisy Time Series
http://pints.readthedocs.io
Other
228 stars 33 forks source link

Loss surface visualisation #400

Closed MichaelClerx closed 4 years ago

MichaelClerx commented 6 years ago

Hi all!

@sanmitraghosh @chonlei and I have been playing with loss surface visualisation lately.

I have some code from Myokit that does similar things in 2d. One method using a 3d plot (requires a special package), and another that uses voronoi diagrams for the plot - since points are usually not equally spaced.

https://github.com/MichaelClerx/myokit/blob/master/myokit/lib/fit.py#L482-L587 https://github.com/MichaelClerx/myokit/blob/master/myokit/lib/fit.py#L1967-L2179

Should we include this in Pints maybe? @martinjrobins ?

Maybe not the 3d one, but the voronoi stuff could be good for examples?

martinjrobins commented 6 years ago

Yea, the voronoi one looks useful for the examples and demonstrating the optimisers/samplers. Is there anyway of making it usable for different number of dimensions? Like a plane-cut through a 3d data set? (I'm guessing not, but thought I'd ask...)

MichaelClerx commented 6 years ago

Hmmm. I think in principle you could do a multi-dimensional voronoi, and then cut a plane through. Since you know all the line equations you could calculate this. Problem is, that'd mean digging into the voronoi code instead of using scipy's!

martinjrobins commented 6 years ago

naaa, I was hoping you could translate the problem into 2d before the voronoi. I've heard bad things about voronoi in dim > 2