Is kernel density estimation function available in pytorch?
If not i need to use detach during conversion from tensor to numpy for kernel density estimation function but it want back propagate gradient. Is there any workaround solution?
Is kernel density estimation function available in pytorch?
If not i need to use detach during conversion from tensor to numpy for kernel density estimation function but it want back propagate gradient. Is there any workaround solution?
No. You will usually need more specialized routines depending on what is trained (knots, bandwidth, density of observations). Mixture density networks or cubic splines could work as “workarounds”, but these are not bundled either of course.
I created a proper PyTorch package called torch-kde of the KernelDensity class from scikit-learn through which you can backpropagate. Enjoy!