Skip to content

Commit

Permalink
add comment for entropy on LocationScale
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Portal committed Jun 13, 2024
1 parent 9062431 commit c93b5d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/families/location_scale.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Base.eltype(::Type{<:MvLocationScale{S, D, L}}) where {S, D, L} = eltype(D)
function StatsBase.entropy(q::MvLocationScale)
@unpack location, scale, dist = q
n_dims = length(location)
# `convert` is necessary because `entropy` is not type stable upstream
n_dims*convert(eltype(location), entropy(dist)) + logdet(scale)
end

Expand Down

1 comment on commit c93b5d7

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Benchmark suite Current: c93b5d7 Previous: 9062431 Ratio
normal + bijector/meanfield/ForwardDiff 529221525.5 ns 565275016.5 ns 0.94
normal + bijector/meanfield/ReverseDiff 187259407 ns 195508939 ns 0.96

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.