KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
semantics::Context_cell< T, N > Class Template Reference

class containing conditioning context for marginal cells More...

#include <Marginal_cell.h>

Inheritance diagram for semantics::Context_cell< T, N >:
semantics::Context_cell_base semantics::Cell

Public Types

typedef boost::shared_ptr
< Context_cell< T, N > > 
Self_ptr
 
typedef Cell_traits< T, N > Traits
 
typedef Categorical_event< N > Key_type
 
typedef boost::unordered_map
< Key_type, Self_ptr
Map
 
- Public Types inherited from semantics::Context_cell_base
typedef boost::shared_ptr
< Context_cell_base
Self_ptr
 
- Public Types inherited from semantics::Cell
typedef boost::shared_ptr< CellSelf_ptr
 
typedef std::vector< size_t > Step_sizes
 

Public Member Functions

 Context_cell (const Key_type &key)
 Constructs a cell which is purely context information. More...
 
 Context_cell (const Context_cell &other)
 copy ctor More...
 
virtual ~Context_cell ()
 destructor More...
 
const Key_typekey () const
 return data More...
 
- Public Member Functions inherited from semantics::Context_cell_base
int diversity () const
 get number of distinct outcomes in this context More...
 
double alpha () const
 get the Dirichlet Process concentration parameter for this context More...
 
virtual void increment_diversity ()
 increment the number of distinct outcomes from this context More...
 
virtual void decrement_diversity ()
 decrement the number of distinct outcomes from this context More...
 
void resample_alpha ()
 resample alpha value from conditional posterior More...
 
double effective_tables () const
 total mass for distribution over the "dish" for a new table More...
 
double effective_observations () const
 total mass for distribution over dish for a new customer More...
 
double table_backoff_weight () const
 probability that a new table will draw from the level above this More...
 
double observation_backoff_weight () const
 probability that a new customer will sit at a new table More...
 
- Public Member Functions inherited from semantics::Cell
const size_t & count () const
 get current count in this cell More...
 
const size_t & table_count () const
 get number of "tables" in this cell More...
 
virtual void increment ()
 increment count More...
 
virtual void decrement ()
 decrement count More...
 
virtual void increment_table_count ()
 increment table count More...
 
virtual void decrement_table_count ()
 decrement table count More...
 

Static Public Member Functions

static void resample_all_alphas ()
 resample all CRP alpha values at this level only More...
 
- Static Public Member Functions inherited from semantics::Context_cell_base
static const double & a ()
 
static const double & b ()
 

Static Public Attributes

static Map map
 
static bool & VERBOSE = Cell::VERBOSE
 
- Static Public Attributes inherited from semantics::Cell
static bool VERBOSE = false
 

Friends

std::ostream & operator (std::ostream &os, const Map &map)
 output a contingency table in human readable form to an ostream More...
 

Additional Inherited Members

- Protected Member Functions inherited from semantics::Context_cell_base
 Context_cell_base ()
 constructor More...
 
- Protected Member Functions inherited from semantics::Cell
 Cell ()
 default ctor More...
 
virtual ~Cell ()
 virtual destructor More...
 
- Protected Attributes inherited from semantics::Cell
size_t count_
 
size_t table_count_
 

Detailed Description

template<typename T, size_t N>
class semantics::Context_cell< T, N >

class containing conditioning context for marginal cells

Member Typedef Documentation

template<typename T, size_t N>
typedef Categorical_event<N> semantics::Context_cell< T, N >::Key_type
template<typename T, size_t N>
typedef boost::unordered_map<Key_type, Self_ptr> semantics::Context_cell< T, N >::Map
template<typename T, size_t N>
typedef boost::shared_ptr<Context_cell<T, N> > semantics::Context_cell< T, N >::Self_ptr
template<typename T, size_t N>
typedef Cell_traits<T,N> semantics::Context_cell< T, N >::Traits

Constructor & Destructor Documentation

template<class T , size_t N>
semantics::Context_cell< T, N >::Context_cell ( const Key_type key)

Constructs a cell which is purely context information.

Parameters
keycontainer holding values of each categorical variable
template<class T , size_t N>
semantics::Context_cell< T, N >::Context_cell ( const Context_cell< T, N > &  other)

copy ctor

template<class T , size_t N>
semantics::Context_cell< T, N >::~Context_cell ( )
virtual

destructor

Member Function Documentation

template<typename T, size_t N>
const Key_type& semantics::Context_cell< T, N >::key ( ) const
inlinevirtual

return data

Implements semantics::Cell.

template<class T , size_t N>
void semantics::Context_cell< T, N >::resample_all_alphas ( )
static

resample all CRP alpha values at this level only

Friends And Related Function Documentation

template<typename T, size_t N>
std::ostream& operator ( std::ostream &  os,
const Map map 
)
friend

output a contingency table in human readable form to an ostream

Member Data Documentation

template<typename T, size_t N>
Context_cell< T, N >::Map semantics::Context_cell< T, N >::map
static
template<typename T, size_t N>
bool & semantics::Context_cell< T, N >::VERBOSE = Cell::VERBOSE
static

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