Open lgrozinger opened 1 year ago
All hail the developers!
Much appreciated :pray:
But for a UnivariateTransformed it does not work.
Unfortunately it doesn't work because the PlanarLayer
works with vectors, not Real
, i.e. this particular pair of distribution and transformation is not compatible. The resulting error message is not particularly informative, but this is due to some useful default implementations.
Unfortunately it doesn't work because the PlanarLayer works with vectors, not Real, i.e. this particular pair of distribution and transformation is not compatible.
Hmmm ok, but I assume you mean that the Bijectors.PlanarLayer works only with vectors, not the mathematical object? Maybe I'm wrong, but the definition in Variational Inference with Normalizing Flows doesn't mention anything about restricting to only vectors?
The resulting error message is not particularly informative, but this is due to some useful default implementations.
If it really cannot be done, perhaps we could return a useful error message when someone tries PlanarLayer(1)
?
Hmmm ok, but I assume you mean that the Bijectors.PlanarLayer works only with vectors, not the mathematical object?
Yeah, the actual transformation does work with a real IIRC.
If it really cannot be done, perhaps we could return a useful error message when someone tries PlanarLayer(1)?
It can be done, but the current implementation assumes we're working with an array and so we'd need to implement something that works with a Real
.
IMO this doesn't quite seem worth it since you can always just do PlanarLayer(1)
and then wrap your x::Real
as an array, i.e. [x]
.
That's not sufficient because PlanarLayer(1)
means "we're going to work with input AbstractVector
of length 1" which is different from working with a Real
.
I agree we should error if you try to call PlanarLayer
on a Real
though; this is definitively something we should add:)
So for now, instead of doing transformed(Normal(), ...)
, just do transformed(MvNormal(zeros(1), LinearAlgebra.I), ...)
.
Ok thank you for your help.
Perhaps when I have a bit of time I can get to grips with the codebase and propose a fix.
That would be very much appreciated @lgrozinger ! Will keep an eye out:)
Taking the
logpdf
of aMultivariateTransformed
works.This is great! All hail the developers! But for a
UnivariateTransformed
it does not work.I understand that most use cases for this package will want
MultivariateTransformed
, but I would have expected this to work. Either I'm missing something or this is a bug. Can anyone confirm either way?I am using Bijectors v0.12.3.