-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
Hey guys, I really like that you provide this package independently from Turing.jl. I am actually making intensive use of Bijectors.jl for a project that I have called PiecewiseInference.jl.
I need to define few custom bijectors, and I would like to make sure that I am doing things right. Here is one that transforms a random variable with values in
struct AbsCap{N,C} <: Bijector{N}
c::C
end
(a::AbsCap)(x) = x .- a.c # transform itself, "forward"
(a::Inverse{<: AbsCap})(y) = abs.(y) .+ a.orig.c # inverse transform, "backward"
logabsdetjac(::Abs{0}, y::Real) = zero(eltype(y))Is everything alright in this piece of code?
Thanks a lot for your help!
Metadata
Metadata
Assignees
Labels
No labels