Public Types | Public Member Functions

graphlab::table_factor< MAX_DIM > Class Template Reference

#include <table_factor.hpp>

List of all members.

Public Types

typedef discrete_variable variable_type
typedef discrete_domain< MAX_DIM > domain_type
typedef discrete_assignment
< MAX_DIM > 
assignment_type
typedef discrete_variable variable_type
typedef discrete_domain< MAX_DIM > domain_type
typedef discrete_assignment
< MAX_DIM > 
assignment_type

Public Member Functions

 table_factor ()
 table_factor (const domain_type &dom)
 table_factor (const table_factor &other)
table_factoroperator= (const table_factor &other)
void set_args (const domain_type &args)
const domain_typeargs () const
const double & logP (size_t index) const
double & logP (size_t index)
const double & logP (const assignment_type &asg) const
double & logP (const assignment_type &asg)
size_t size () const
size_t num_vars () const
double * begin ()
const double * begin () const
double * end ()
const double * end () const
void zero ()
void uniform ()
void uniform (double value)
void normalize ()
 ensure that sum_x this(x) = 1
void shift_normalize ()
bool is_finite ()
table_factoroperator+= (const table_factor &other)
 this(x) += other(x);
table_factoroperator*= (const table_factor &other)
 this(x) *= other(x);
table_factor operator* (const table_factor &other) const
 Create a table factor on the fly.
table_factoroperator/= (const table_factor &other)
 this(x) /= other(x);
table_factor operator/ (const table_factor &other) const
 Create a table factor on the fly.
void convolve (const table_factor &joint, const table_factor &other)
 this(x) = sum_y joint(x,y) * other(y)
void condition (const table_factor &other, const assignment_type &asg)
void times_condition (const table_factor &other, const assignment_type &asg)
 this(x) = this(x) other(x, y = asg)
void marginalize (const table_factor &joint)
void damp (const table_factor &other, double damping)
 This = other * damping + this * (1-damping).
double l1_diff (const table_factor &other) const
 compute the average l1 norm between to factors
double l1_logdiff (const table_factor &other) const
 compute the l1 norm in log space
assignment_type max_asg () const
void expectation (std::vector< double > &values) const
assignment_type sample () const
void set_as_agreement (double lambda)
void set_as_laplace (double lambda)
void load (iarchive &arc)
void save (oarchive &arc) const
 table_factor (const domain_type &dom)
 table_factor (const table_factor &other)
table_factoroperator= (const table_factor &other)
void set_args (const domain_type &args)
const domain_typeargs () const
const double & logP (size_t index) const
double & logP (size_t index)
const double & logP (const assignment_type &asg) const
double & logP (const assignment_type &asg)
size_t size () const
size_t num_vars () const
double * begin ()
const double * begin () const
double * end ()
const double * end () const
void zero ()
void uniform ()
void uniform (double value)
void normalize ()
 ensure that sum_x this(x) = 1
table_factoroperator+= (const table_factor &other)
 this(x) += other(x);
table_factoroperator*= (const table_factor &other)
 this(x) *= other(x);
table_factor operator* (const table_factor &other) const
 Create a table factor on the fly.
table_factoroperator/= (const table_factor &other)
 this(x) /= other(x);
table_factor operator/ (const table_factor &other) const
 Create a table factor on the fly.
void convolve (const table_factor &joint, const table_factor &other)
 this(x) = sum_y joint(x,y) * other(y)
void condition (const table_factor &other, const assignment_type &asg)
 this(x) = other(x, y = asg)
void times_condition (const table_factor &other, const assignment_type &asg)
 this(x) = this(x) other(x, y = asg)
void marginalize (const table_factor &joint)
 this(x) = sum_y joint(x,y)
void damp (const table_factor &other, double damping)
 This = other * damping + this * (1-damping).
double l1_diff (const table_factor &other) const
 compute the average l1 norm between to factors
double l1_logdiff (const table_factor &other) const
 compute the l1 norm in log space
assignment_type max_asg () const
void expectation (std::vector< double > &values) const
assignment_type sample () const
void set_as_agreement (double lambda)
void set_as_laplace (double lambda)
void load (iarchive &arc)
void save (oarchive &arc) const

Detailed Description

template<size_t MAX_DIM>
class graphlab::table_factor< MAX_DIM >

A factor over up to max_dim dimensions

Definition at line 79 of file table_factor.hpp.


Constructor & Destructor Documentation

template<size_t MAX_DIM>
graphlab::table_factor< MAX_DIM >::table_factor (  )  [inline]

Construct an empty table factor

Definition at line 87 of file table_factor.hpp.

template<size_t MAX_DIM>
graphlab::table_factor< MAX_DIM >::table_factor ( const domain_type dom  )  [inline]

Construct a table factor over the given domain

Definition at line 90 of file table_factor.hpp.

template<size_t MAX_DIM>
graphlab::table_factor< MAX_DIM >::table_factor ( const table_factor< MAX_DIM > &  other  )  [inline]

Construct a copy

Definition at line 94 of file table_factor.hpp.


Member Function Documentation

template<size_t MAX_DIM>
void graphlab::table_factor< MAX_DIM >::condition ( const table_factor< MAX_DIM > &  other,
const assignment_type &  asg 
) [inline]

this(x) = other(x, y = asg)

Definition at line 351 of file table_factor.hpp.

template<size_t MAX_DIM>
void graphlab::table_factor< MAX_DIM >::expectation ( std::vector< double > &  values  )  const [inline]

Compute the expectation of the table factor

Definition at line 535 of file table_factor.hpp.

template<size_t MAX_DIM>
bool graphlab::table_factor< MAX_DIM >::is_finite (  )  [inline]

Return false if any of the entries are not finite

Definition at line 215 of file table_factor.hpp.

template<size_t MAX_DIM>
void graphlab::table_factor< MAX_DIM >::marginalize ( const table_factor< MAX_DIM > &  joint  )  [inline]

this(x) = sum_y joint(x,y)

Definition at line 439 of file table_factor.hpp.

template<size_t MAX_DIM>
table_factor& graphlab::table_factor< MAX_DIM >::operator= ( const table_factor< MAX_DIM > &  other  )  [inline]

Standard assignment operator

Definition at line 98 of file table_factor.hpp.

template<size_t MAX_DIM>
assignment_type graphlab::table_factor< MAX_DIM >::sample (  )  const [inline]

Draw a sample from the table factor

Definition at line 555 of file table_factor.hpp.

template<size_t MAX_DIM>
void graphlab::table_factor< MAX_DIM >::set_as_agreement ( double  lambda  )  [inline]

Construct a binary agreement factor

Definition at line 575 of file table_factor.hpp.

template<size_t MAX_DIM>
void graphlab::table_factor< MAX_DIM >::shift_normalize (  )  [inline]

Ensure that the largest value in log form is zero. This prevents overflows on normalization.

Definition at line 203 of file table_factor.hpp.


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