cpmpercussion / keras-mdn-layer

An MDN Layer for Keras using TensorFlow's distributions module
MIT License
165 stars 44 forks source link

Convert to a scipy distribution object #25

Open yoavram opened 4 years ago

yoavram commented 4 years ago

It would be nice to have a helper function that takes the output of the model and converts it to a scipy.stats rv object so that it can be used to compute density or cumulative density, etc. I’m guessing it’s not complicated to do, looking at the example in https://github.com/cpmpercussion/keras-mdn-layer/blob/master/notebooks/MDN-2D-spiral-prediction.ipynb (specifically the cell starting with “Plot the means”).

cpmpercussion commented 4 years ago

Hm, I'm not really sure what a scipy.stats rv object is, so probably something that would be better handled by someone into using scipy.stats regularly.

yoavram commented 4 years ago

For the record, this is an rv (random variable) in scipy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_continuous.html