File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -534,7 +534,8 @@ Elements with probability 0 or 1 add 0 to the entropy.
534534"""
535535function entropy (p)
536536 if isempty (p)
537- throw (ArgumentError (" empty collections of probabilities are not supported" ))
537+ throw (ArgumentError (" empty collections are not supported since they do not " *
538+ " represent proper probability distributions" ))
538539 end
539540 return - sum (xlogx, p)
540541end
@@ -595,7 +596,8 @@ function crossentropy(p::AbstractArray{<:Real}, q::AbstractArray{<:Real})
595596 # handle empty collections
596597 if isempty (p)
597598 Base. depwarn (
598- " support for empty collections of probabilities will be removed" ,
599+ " support for empty collections will be removed since they do not " *
600+ " represent proper probability distributions" ,
599601 :crossentropy ,
600602 )
601603 # return zero for empty arrays
@@ -625,7 +627,8 @@ function kldivergence(p::AbstractArray{<:Real}, q::AbstractArray{<:Real})
625627 # handle empty collections
626628 if isempty (p)
627629 Base. depwarn (
628- " support for empty collections of probabilities will be removed" ,
630+ " support for empty collections will be removed since they do not " *
631+ " represent proper probability distributions" ,
629632 :kldivergence ,
630633 )
631634 # return zero for empty arrays
You can’t perform that action at this time.
0 commit comments