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 : pRC::zero<T>();
215 [](
T const &pDE,
T const &pThetaE)
217 return pDE * log(pThetaE);
219 [](
T const &pDE,
T const &pThetaE)
221 return pDE / pThetaE;
Class storing a KL Score, specializes the Score class.
Definition: score.hpp:205
KLScore(KLScore &&)=default
KLScore(KLScore const &)=default
KLScore & operator=(KLScore const &) &=default
KLScore & operator=(KLScore &&) &=default
KLScore()
Definition: score.hpp:213
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:183
auto & threshold()
Definition: score.hpp:178
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
pRC::Float<> T
Definition: externs_nonTT.hpp:1
Definition: calculate_pTheta.hpp:15