You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using edward2==0.0.1 in combination with tensorflow_probability==0.9.0 and tensorflow==2.1.0, all installed from pip.
I am facing an issue with ed.TransformedDistribution that feel like a regression to me.
importedward2asedimporttensorflow_probabilityastfptfb=tfp.bijectorsnormal=ed.Normal(0., 1.)
shifted_normal=ed.TransformedDistribution(normal, tfb.Shift(0.5))
# This raises with AttributeError: 'RandomVariable' object has no attribute 'name'
I can patch the case 1 by passing normal.distribution to ed.TransformedDistribution but I don't think this is desirable.
The text was updated successfully, but these errors were encountered:
Thanks for raising this! In the code, we minimally wrap all distributions as ed2 rvs, and the input types are the same as distributions (this is why ed.TransformedDistribution still takes a distribution as input).
One way to resolve this is to augment all higher-order distributions that take a distribution as input to take a RandomVariable as input (that is, raising all tfp.Distribution types to ed.RandomVariable types). It's easy to do this on a one-off basis, but we haven't quite figured out how to automate this which would be better for maintenance.
Ah yes that sounds tricky if you don't want to break the open close principles.
Also even doing it on a case by case basis may prove complicated.
For example, someone coded a distribution by subclassing the Transformed Distribution instead of composing it (I might send a PR for that one...), so you wouldn't be able to check the bases of the classes not their attributes either...
Hi,
I am using edward2==0.0.1 in combination with tensorflow_probability==0.9.0 and tensorflow==2.1.0, all installed from pip.
I am facing an issue with
ed.TransformedDistribution
that feel like a regression to me.I can patch the case 1 by passing
normal.distribution
toed.TransformedDistribution
but I don't think this is desirable.The text was updated successfully, but these errors were encountered: