#include <unary_factor.hpp>
Public Member Functions | |
| unary_factor (uint32_t var=0, uint16_t arity=0) | |
| unary_factor (const unary_factor &other) | |
| unary_factor & | operator= (const unary_factor &other) |
| void | resize (uint16_t arity) |
| uint32_t & | var () |
| const uint32_t & | var () const |
| uint16_t | arity () const |
| double & | logP (size_t asg) |
| const double & | logP (size_t asg) const |
| void | uniform (double value=0) |
| void | normalize () |
| void | times (const unary_factor &other) |
| void | plus (const unary_factor &other) |
| void | divide (const unary_factor &other) |
| void | convolve (const binary_factor &bin_fact, const unary_factor &other) |
| void | condition (const binary_factor &bin_fact, uint16_t asg) |
| void | damp (const unary_factor &other, double damping) |
| double | residual (const unary_factor &other) const |
| size_t | max_asg () const |
| double | expectation () const |
| size_t | sample () const |
| void | save (oarchive &oarc) const |
| void | load (iarchive &iarc) |
A unary factor is a table over a single variable and is associated with edge variable in the pairwise markov random field. Unary factors are also used to represent messages. All data is represented in log form.
Definition at line 57 of file unary_factor.hpp.
| void graphlab::unary_factor::condition | ( | const binary_factor & | bin_fact, | |
| uint16_t | asg | |||
| ) | [inline] |
this(x) = this(x) * fact(x, asg)
Definition at line 161 of file unary_factor.hpp.
| void graphlab::unary_factor::convolve | ( | const binary_factor & | bin_fact, | |
| const unary_factor & | other | |||
| ) | [inline] |
this(x) = sum_y fact(x,y) * other(y)
Definition at line 144 of file unary_factor.hpp.
| void graphlab::unary_factor::damp | ( | const unary_factor & | other, | |
| double | damping | |||
| ) | [inline] |
This = other * damping + this * (1-damping)
Definition at line 171 of file unary_factor.hpp.
| void graphlab::unary_factor::divide | ( | const unary_factor & | other | ) | [inline] |
this(x) /= other(x);
Definition at line 137 of file unary_factor.hpp.
| double graphlab::unary_factor::expectation | ( | ) | const [inline] |
Get the expected assignment
Definition at line 207 of file unary_factor.hpp.
| size_t graphlab::unary_factor::max_asg | ( | ) | const [inline] |
get the max assignment
Definition at line 194 of file unary_factor.hpp.
| void graphlab::unary_factor::normalize | ( | ) | [inline] |
ensure that sum_x this(x) = 1
Definition at line 99 of file unary_factor.hpp.
| void graphlab::unary_factor::plus | ( | const unary_factor & | other | ) | [inline] |
this(x) += other(x);
Definition at line 129 of file unary_factor.hpp.
| double graphlab::unary_factor::residual | ( | const unary_factor & | other | ) | const [inline] |
Compute the residual between two unary factors
Definition at line 183 of file unary_factor.hpp.
| size_t graphlab::unary_factor::sample | ( | ) | const [inline] |
Draw a random sample from the factor
Definition at line 218 of file unary_factor.hpp.
| void graphlab::unary_factor::times | ( | const unary_factor & | other | ) | [inline] |
this(x) *= other(x);
Definition at line 122 of file unary_factor.hpp.
| void graphlab::unary_factor::uniform | ( | double | value = 0 |
) | [inline] |
zero out the factor
Definition at line 93 of file unary_factor.hpp.
1.7.1