Closed torfjelde closed 1 year ago
This is a fairly big one @devmotion , but I would greatly appreciate it if you had a super-quick look. The main part is just removing the dimensionality completely from the definition of the bijectors, in addition to a couple of small things:
transform!
, logabsdetjac!
, and with_logabsdet_jacobian!
(should this maybe go to ChangesOfVariables.jl?).elementwise(exp)
to indicate that a method should be applied elementwise (equivalent to Base.Fix1(broadcast, exp)
).I'm also going to make a separate PR to remove the stuff related to ADbackend
.
This will be a huge breaking release, as I think it's time we just rip the band-aid off.
@yebai you might also want to take a look at this
I think I've replied/addressed your comments now @devmotion
Some I'm of the opinion that we leave until later PRs, given how long this PR has been in the pipeline + a lot of improvements we want to do (e.g. adding a VecCorr
bijector) are dependent on this PR making it's way through.
Yeah, let's just make another breaking release if it becomes necessary. I think I checked yesterday and Bijectors only has ~9 direct dependents, so it's not too bad if we iterate and release multiple breaking versions if needed (of course, it would be better to have the optimal design right away but that's completely unrealistic :smile:).
Bueno! You "happy" with the current version of the PR then?
Thanks, @torfjelde @devmotion -- it looks good to me. I agree that we can keep improving the design in new PRs.
This PR is an attempt at a couple of things:
Bijector
.TODOs:
logpdf_with_jac
,logpdf_forward
,forward(d::Distribution, ...)
?forward
no longer works for multiple samples because we no longer have support for batched inputs.