Skip to content

Commit

Permalink
Merge branch 'master' into torfjelde/product-bijector
Browse files Browse the repository at this point in the history
  • Loading branch information
torfjelde committed Apr 18, 2024
2 parents 52af91d + e522155 commit d6356f7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Bijectors"
uuid = "76274a88-744f-5084-9051-94815aaf08c4"
version = "0.13.8"
version = "0.13.9"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
6 changes: 6 additions & 0 deletions src/bijectors/simplex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ function logabsdetjac(b::SimplexBijector, x::AbstractVector{T}) where {T}

return -lp
end

# Needed to avoid falling back to `with_logabsdet_jacobian` for matrix inputs.
function logabsdetjac(b::SimplexBijector, x::AbstractMatrix{<:Real})
return sum(Base.Fix1(logabsdetjac, b), eachcol(x))
end

function simplex_logabsdetjac_gradient(x::AbstractVector)
T = eltype(x)
ϵ = _eps(T)
Expand Down
1 change: 1 addition & 0 deletions test/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ end
filldist(Exponential(), 2),
filldist(Exponential(), 2, 3),
filldist(filldist(Exponential(), 2), 3),
filldist(Dirichlet(ones(2)), 3),
]
x = rand(dist)
b = bijector(dist)
Expand Down

0 comments on commit d6356f7

Please sign in to comment.