aGrUM  0.13.2
gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc > Class Template Reference

the no a priori class: corresponds to 0 weight-sample More...

#include <aprioriNoApriori.h>

+ Inheritance diagram for gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >:
+ Collaboration diagram for gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >:

Public Member Functions

Constructors / Destructors
 AprioriNoApriori ()
 default constructor More...
 
virtual AprioriNoApriori< IdSetAlloc, CountAlloc > * copyFactory () const
 virtual copy constructor More...
 
virtual ~AprioriNoApriori ()
 destructor More...
 
Accessors / Modifiers
virtual void compute () final
 include the apriori into a given set of counts More...
 
virtual bool isOfType (const std::string &type) final
 indicates whether an apriori is of a certain type More...
 
virtual const std::string & getType () const noexceptfinal
 returns the type of the apriori More...
 
virtual void setWeight (double weight) final
 sets the weight of the a priori More...
 
Accessors / Modifiers
double weight () const noexcept
 returns the weight assigned to the apriori More...
 
void setParameters (const std::vector< Size > &modalities, std::vector< std::vector< double, CountAlloc > > &counts, const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &target_nodesets, const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &conditioning_nodesets)
 sets the parameters for the apriori More...
 
const std::vector< double, CountAlloc > & getAllApriori (Idx index)
 returns the apriori vector for a given (conditioned) target set More...
 
const std::vector< double, CountAlloc > & getConditioningApriori (Idx index)
 returns the apriori vector for a conditioning set More...
 

Public Types

using type = AprioriNoAprioriType
 

Protected Attributes

double _weight {1.0f}
 the weight of the apriori More...
 
const std::vector< Size > * _modalities {nullptr}
 the modalities of the nodes More...
 
std::vector< std::vector< double, CountAlloc > > * _unapriori_counts {nullptr}
 the counts that were performed by the class on which we add an apriori More...
 
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > * _target_nodesets {nullptr}
 the set of target + cond nodes, and their counting indices More...
 
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > * _conditioning_nodesets {nullptr}
 the set of conditioning nodesets More...
 
std::vector< std::vector< double, CountAlloc > > _apriori_counts
 the a priori More...
 

Protected Member Functions

 AprioriNoApriori (const AprioriNoApriori< IdSetAlloc, CountAlloc > &from)
 copy constructor More...
 
 AprioriNoApriori (AprioriNoApriori< IdSetAlloc, CountAlloc > &&from)
 move constructor More...
 
AprioriNoApriori< IdSetAlloc, CountAlloc > & operator= (const AprioriNoApriori< IdSetAlloc, CountAlloc > &)=delete
 prevent copy operator More...
 

Detailed Description

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
class gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >

the no a priori class: corresponds to 0 weight-sample

Definition at line 43 of file aprioriNoApriori.h.

Member Typedef Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
using gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::type = AprioriNoAprioriType

Definition at line 45 of file aprioriNoApriori.h.

Constructor & Destructor Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::AprioriNoApriori ( )

default constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::~AprioriNoApriori ( )
virtual

destructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::AprioriNoApriori ( const AprioriNoApriori< IdSetAlloc, CountAlloc > &  from)
protected

copy constructor

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::AprioriNoApriori ( AprioriNoApriori< IdSetAlloc, CountAlloc > &&  from)
protected

move constructor

Member Function Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::compute ( )
finalvirtual

include the apriori into a given set of counts

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual AprioriNoApriori< IdSetAlloc, CountAlloc >* gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::copyFactory ( ) const
virtual

virtual copy constructor

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< double, CountAlloc >& gum::learning::Apriori< IdSetAlloc, CountAlloc >::getAllApriori ( Idx  index)
inherited

returns the apriori vector for a given (conditioned) target set

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< double, CountAlloc >& gum::learning::Apriori< IdSetAlloc, CountAlloc >::getConditioningApriori ( Idx  index)
inherited

returns the apriori vector for a conditioning set

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual const std::string& gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::getType ( ) const
finalvirtualnoexcept

returns the type of the apriori

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual bool gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::isOfType ( const std::string &  type)
finalvirtual

indicates whether an apriori is of a certain type

Implements gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
AprioriNoApriori< IdSetAlloc, CountAlloc >& gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::operator= ( const AprioriNoApriori< IdSetAlloc, CountAlloc > &  )
protecteddelete

prevent copy operator

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
void gum::learning::Apriori< IdSetAlloc, CountAlloc >::setParameters ( const std::vector< Size > &  modalities,
std::vector< std::vector< double, CountAlloc > > &  counts,
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &  target_nodesets,
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx > * > &  conditioning_nodesets 
)
inherited

sets the parameters for the apriori

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
virtual void gum::learning::AprioriNoApriori< IdSetAlloc, CountAlloc >::setWeight ( double  weight)
finalvirtual

sets the weight of the a priori

Reimplemented from gum::learning::Apriori< IdSetAlloc, CountAlloc >.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
double gum::learning::Apriori< IdSetAlloc, CountAlloc >::weight ( ) const
noexceptinherited

returns the weight assigned to the apriori

Member Data Documentation

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::vector< double, CountAlloc > > gum::learning::Apriori< IdSetAlloc, CountAlloc >::_apriori_counts
protectedinherited

the a priori

Definition at line 130 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_conditioning_nodesets {nullptr}
protectedinherited

the set of conditioning nodesets

for details, see _target_nodesets

Definition at line 127 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< Size >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_modalities {nullptr}
protectedinherited

the modalities of the nodes

Definition at line 105 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
const std::vector< std::pair< std::vector< Idx, IdSetAlloc >, Idx >* >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_target_nodesets {nullptr}
protectedinherited

the set of target + cond nodes, and their counting indices

The first element of the pairs correspond to a nodeset and the second one to the corresponding index in _unapriori_counts. Some pointers on the pair might be nullptr. In this case, this means that the countings have already been processed and have been put into a cache. So, for these pointers, no a priori operation needs be performed.

Definition at line 122 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
std::vector< std::vector< double, CountAlloc > >* gum::learning::Apriori< IdSetAlloc, CountAlloc >::_unapriori_counts {nullptr}
protectedinherited

the counts that were performed by the class on which we add an apriori

Say that a score needs an apriori, then _unapriori_counts corresponds to the countings performed by the score. Those are given to the apriori so that the latter can add what is needed to _unapriori_counts to take into account the so-called apriori.

Definition at line 112 of file apriori.h.

template<typename IdSetAlloc = std::allocator< Idx >, typename CountAlloc = std::allocator< double >>
double gum::learning::Apriori< IdSetAlloc, CountAlloc >::_weight {1.0f}
protectedinherited

the weight of the apriori

Definition at line 102 of file apriori.h.


The documentation for this class was generated from the following file: