3#ifndef cMHN_COMMON_SCORE_H
4#define cMHN_COMMON_SCORE_H
46 return mPointwiseScore(pDE, pThetaE);
51 return mPointwiseDSDP(pDE, pThetaE);
60 std::function<
T(
T,
T)> mPointwiseScore;
61 std::function<
T(
T,
T)> mPointwiseDSDP;
93 [this](
T const &pDE,
T const &pThetaE)
95 if(pThetaE > mThreshold)
97 return pDE * log(pThetaE);
101 T deltaPThetaE = pThetaE - mThreshold;
102 return pDE * log(mThreshold) +
104 (deltaPThetaE / mThreshold -
105 deltaPThetaE * deltaPThetaE /
106 (
T(2) * mThreshold * mThreshold));
109 [
this](
T const &pDE,
T const &pThetaE)
111 if(pThetaE > mThreshold)
113 return pDE / pThetaE;
117 return -pDE * (pThetaE -
T(2) * mThreshold) /
118 (mThreshold * mThreshold);
165 [this](
T const &pDE,
T const &pThetaE)
167 return pDE * log(max(pThetaE, mEpsilon));
169 [
this](
T const &pDE,
T const &pThetaE)
171 return pThetaE > mEpsilon ? pDE / pThetaE
218 [this](
T const &pDE,
T const &pThetaE)
225 return (pDE + eps) * log(pThetaE + eps);
227 [
this](
T const &pDE,
T const &pThetaE)
234 return (pDE + eps) / (pThetaE + eps);
279 [this](
T const &pDE,
T const &pThetaE)
281 return (pDE + mEpsilon) * log(pThetaE + mEpsilon);
283 [
this](
T const &pDE,
T const &pThetaE)
285 return (pDE + mEpsilon) / (pThetaE + mEpsilon);
329 [](
T const &pDE,
T const &pThetaE)
331 return pDE * log(pThetaE);
333 [](
T const &pDE,
T const &pThetaE)
335 return pDE / pThetaE;
Class storing a KL Score, specializes the Score class.
Definition score.hpp:319
KLScore(KLScore &&)=default
KLScore(KLScore const &)=default
KLScore & operator=(KLScore const &) &=default
KLScore & operator=(KLScore &&) &=default
KLScore()
Definition score.hpp:327
Class storing a KL-Taylor-Hybrid Score, specializes the Score class.
Definition score.hpp:83
auto & threshold()
Definition score.hpp:126
KLTHScore & operator=(KLTHScore const &) &=default
KLTHScore(KLTHScore const &)=default
KLTHScore(KLTHScore &&)=default
auto const threshold() const
Definition score.hpp:131
KLTHScore(T const &threshold)
Definition score.hpp:91
KLTHScore & operator=(KLTHScore &&) &=default
Class storing a KL-epsilon Score, specializes the Score class.
Definition score.hpp:155
KLepsScore & operator=(KLepsScore &&) &=default
KLepsScore(KLepsScore const &)=default
KLepsScore & operator=(KLepsScore const &) &=default
KLepsScore(T const &epsilon)
Definition score.hpp:163
KLepsScore(KLepsScore &&)=default
auto const epsilon() const
Definition score.hpp:184
auto & threshold()
Definition score.hpp:179
Class storing all relevant information for a score.
Definition score.hpp:27
auto pointwiseScore(T const &pDE, T const &pThetaE) const
Definition score.hpp:44
Score(Score const &)=default
Score(auto const &pointwiseScore, auto const &pointwiseDSDP, auto const &name)
Definition score.hpp:36
Score & operator=(Score const &) &=default
auto name() const
Definition score.hpp:54
Score & operator=(Score &&) &=default
auto pointwiseDSDP(T const &pDE, T const &pThetaE) const
Definition score.hpp:49
Class storing an sKL Score, specializes the Score class.
Definition score.hpp:269
sKLScore(T const &epsilon)
Definition score.hpp:277
sKLScore & operator=(sKLScore const &) &=default
sKLScore(sKLScore &&)=default
auto const epsilon() const
Definition score.hpp:297
sKLScore & operator=(sKLScore &&) &=default
sKLScore(sKLScore const &)=default
auto & epsilon()
Definition score.hpp:292
Class storing a dynamic sKL Score, specializes the Score class.
Definition score.hpp:208
sKLdynScore & operator=(sKLdynScore &&) &=default
sKLdynScore(sKLdynScore const &)=default
sKLdynScore(sKLdynScore &&)=default
auto const delta() const
Definition score.hpp:246
sKLdynScore & operator=(sKLdynScore const &) &=default
auto & delta()
Definition score.hpp:241
sKLdynScore(T const &delta)
Definition score.hpp:216
pRC::Float<> T
Definition externs_nonTT.hpp:1
Definition calculate_pTheta.hpp:16
static constexpr auto makeConstantSequence()
Definition sequence.hpp:402
static constexpr auto zero()
Definition zero.hpp:12