template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::probability_result_t>
status_t kld(
in_type_ const *p,
in_type_ const *q,
std::size_t d,
result_type_ *r,
nk_capability_t capabilities = default_capabilities(),
nk_stream_t stream = nullptr) noexcept; template <numeric_dtype in_type_, numeric_dtype result_type_ = typename in_type_::probability_result_t, vector_of<in_type_> a_type_, vector_of<in_type_> b_type_>
expected<result_type_> kld(
a_type_ const & a,
b_type_ const & b,
nk_capability_t capabilities = default_capabilities()) noexcept; Kullback-Leibler divergence of two distributions with equal dimensions; unexpected_dimensions_k when they differ or either run is strided or ends mid-value.
Parameters
p | in | First probability distribution |
|---|---|---|
q | in | Second probability distribution |
d | in | Number of dimensions in input vectors |
r | out | Pointer to output divergence value |
capabilities | in | Capabilities to pick from, or zero for the C++ template |
stream | in | Null on the CPU, or the stream of the device capabilities describes |