-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I've been previously thinking about whether and how a density interface should include the possibility to require or check for normalization, so I'm just posing this for discussion here.
Options that come to my mind:
# extra argument and dispatch
logdensityof(d, x; normalized=Val{false}())Or maybe include a whole machinery for dealing with normalization constants?
# like eltype/length traits
hasnormalizingconstant(d) = false
normalizingconstant(d::SomeDensity) = ...
isnormalized(d) = normalizingconstant(d) == 1
# probably should be its own struct
normalize(d) = let logZ = log(normalizingconstant(d))
logfuncdensity(x -> logdensityof(d, x) - logZ)
endMetadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request