File statistics_update_candidate_common.hpp¶
-
class AbstractStatisticsUpdateCandidate : public IStatisticsUpdateCandidate¶
- #include <statistics_update_candidate_common.hpp>
A base class for all classes that store scores that have been calculated based on statistics and allow to update these statistics accordingly.
Public Functions
-
inline explicit AbstractStatisticsUpdateCandidate(const IScoreVector &scoreVector)¶
- Parameters:
scoreVector – A reference to an object of type
IScoreVectorthat stores the calculated scores
-
inline virtual ~AbstractStatisticsUpdateCandidate() override¶
-
inline virtual void visit(BitVisitor<CompleteIndexVector> completeBitVisitor, BitVisitor<PartialIndexVector> partialBitVisitor, DenseVisitor<float32, CompleteIndexVector> completeDense32BitVisitor, DenseVisitor<float32, PartialIndexVector> partialDense32BitVisitor, DenseVisitor<float64, CompleteIndexVector> completeDense64BitVisitor, DenseVisitor<float64, PartialIndexVector> partialDense64BitVisitor, DenseBinnedVisitor<float32, CompleteIndexVector> completeDenseBinned32BitVisitor, DenseBinnedVisitor<float32, PartialIndexVector> partialDenseBinned32BitVisitor, DenseBinnedVisitor<float64, CompleteIndexVector> completeDenseBinned64BitVisitor, DenseBinnedVisitor<float64, PartialIndexVector> partialDenseBinned64BitVisitor) const final override¶
Invokes one of the given visitor functions, depending on which one is able to handle the particular type of vector that stores the calculated scores.
- Parameters:
completeBitVisitor – The visitor function for handling objects of type
BitScoreVector<CompleteIndexVector>partialBitVisitor – The visitor function for handling objects of type
BitScoreVector<PartialIndexVector>completeDense32BitVisitor – The visitor function for handling objects of type
DenseScoreVector<float32, CompleteIndexVector>partialDense32BitVisitor – The visitor function for handling objects of type
DenseScoreVector<float32, PartialIndexVector>completeDense64BitVisitor – The visitor function for handling objects of type
DenseScoreVector<float64, CompleteIndexVector>partialDense64BitVisitor – The visitor function for handling objects of type
DenseScoreVector<float64, PartialIndexVector>completeDenseBinned32BitVisitor – The visitor function for handling objects of type
DenseBinnedScoreVector<float32, CompleteIndexVector>partialDenseBinned32BitVisitor – The visitor function for handling objects of type
DenseBinnedScoreVector<float32, PartialIndexVector>completeDenseBinned64BitVisitor – The visitor function for handling objects of type
DenseBinnedScoreVector<float32, CompleteIndexVector>partialDenseBinned64BitVisitor – The visitor function for handling objects of type
DenseBinnedScoreVector<float64, PartialIndexVector>
Protected Functions
-
inline virtual void invokeVisitor(BitVisitor<CompleteIndexVector> visitor, const BitScoreVector<CompleteIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
BitVisitorfor handling objects of typeBitScoreVector<CompleteIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
BitScoreVector<CompleteIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(BitVisitor<PartialIndexVector> visitor, const BitScoreVector<PartialIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
BitVisitorfor handling objects of typeBitScoreVector<PartialIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
BitScoreVector<PartialIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseVisitor<float32, CompleteIndexVector> visitor, const DenseScoreVector<float32, CompleteIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseVisitorfor handling objects of typeDenseScoreVector<float32, CompleteIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseScoreVector<float32, CompleteIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseVisitor<float32, PartialIndexVector> visitor, const DenseScoreVector<float32, PartialIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseVisitorfor handling objects of typeDenseScoreVector<float32, PartialIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseScoreVector<float32, PartialIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseVisitor<float64, CompleteIndexVector> visitor, const DenseScoreVector<float64, CompleteIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseVisitorfor handling objects of typeDenseScoreVector<float64, CompleteIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseScoreVector<float64, CompleteIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseVisitor<float64, PartialIndexVector> visitor, const DenseScoreVector<float64, PartialIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseVisitorfor handling objects of typeDenseScoreVector<float64, PartialIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseScoreVector<float64, PartialIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseBinnedVisitor<float32, CompleteIndexVector> visitor, const DenseBinnedScoreVector<float32, CompleteIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseBinnedVisitorfor handling objects of typeDenseBinnedScoreVector<float32, CompleteIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseBinnedScoreVector<float32, CompleteIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseBinnedVisitor<float32, PartialIndexVector> visitor, const DenseBinnedScoreVector<float32, PartialIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseBinnedVisitorfor handling objects of typeDenseBinnedScoreVector<float32, PartialIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseBinnedScoreVector<float32, PartialIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseBinnedVisitor<float64, CompleteIndexVector> visitor, const DenseBinnedScoreVector<float64, CompleteIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseBinnedVisitorfor handling objects of typeDenseBinnedScoreVector<float64, CompleteIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseBinnedScoreVector<float64, CompleteIndexVector>to be handled by the visitor
-
inline virtual void invokeVisitor(DenseBinnedVisitor<float64, PartialIndexVector> visitor, const DenseBinnedScoreVector<float64, PartialIndexVector> &scoreVector) const¶
May be overridden by subclasses in order to invoke a given
DenseBinnedVisitorfor handling objects of typeDenseBinnedScoreVector<float64, PartialIndexVector>.- Parameters:
visitor – The visitor to be invoked
scoreVector – A reference to an object of type
DenseBinnedScoreVector<float64, PartialIndexVector>to be handled by the visitor
Private Members
-
const IScoreVector &scoreVector_¶
-
template<typename State, typename IndexVector>
class StatisticsUpdate : public IStatisticsUpdate¶ - #include <statistics_update_candidate_common.hpp>
Allows updating the statistics.
- Template Parameters:
State – The type of the state of the statistics
IndexVector – The type of the vector that provides access to the indices of the outputs for which confusion matrices should be updated
Public Functions
-
inline StatisticsUpdate(State &state, typename IndexVector::const_iterator indicesBegin, typename IndexVector::const_iterator indicesEnd, typename View<typename State::score_type>::const_iterator scoresBegin, typename View<typename State::score_type>::const_iterator scoresEnd)¶
- Parameters:
state – A reference to an object of template type
Statethat should be updatedindicesBegin – An iterator to the beginning of the output indices for which statistics should be updated
indicesEnd – An iterator to the end of the output indices for which statistics should be updated
scoresBegin – An iterator to the beginning of the predicted scores, corresponding to the given output indices, that should be used for updating the statistics
scoresEnd – An iterator to the end of the predicted scores, corresponding to the given output indices, that should be used for updating the statistics
-
inline virtual void applyPrediction(uint32 statisticIndex) override¶
Updates a specific statistic.
This function must be called for each statistic that is covered by a new rule before learning the next rule.
- Parameters:
statisticIndex – The index of the statistic that should be updated
-
inline virtual void revertPrediction(uint32 statisticIndex) override¶
Reverts a specific statistic that has previously been updated via the function
applyPrediction.- Parameters:
statisticIndex – The index of the statistic that should be updated
-
template<typename State>
class StatisticsUpdateFactory : public IStatisticsUpdateFactory<State::score_type>¶ - #include <statistics_update_candidate_common.hpp>
Allows to create instances of the type
IStatisticsUpdatethat allow updating the statistics.- Template Parameters:
State – The type of the state of the statistics
Public Functions
-
inline StatisticsUpdateFactory(State &state)¶
- Parameters:
state – A reference to an object of template type
Statethat should be updated
-
inline virtual std::unique_ptr<IStatisticsUpdate> create(CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd, typename View<typename State::score_type>::const_iterator scoresBegin, typename View<typename State::score_type>::const_iterator scoresEnd) override¶
See also
-
inline std::unique_ptr<IStatisticsUpdate> create(PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd, typename View<typename State::score_type>::const_iterator scoresBegin, typename View<typename State::score_type>::const_iterator scoresEnd) override¶
See also
-
inline explicit AbstractStatisticsUpdateCandidate(const IScoreVector &scoreVector)¶