golib
0.5
|
The max-sum algorithm. More...
#include <gomaxsum.h>
Public Member Functions | |
virtual bool | run (goFGNode< T, Tfloat > *root, goFactorGraph< T, Tfloat > &fg) |
Run the max-sum algorithm. More... | |
bool | variableSend (goFGNode< T, Tfloat > *fgn, goIndex_t parentIndex) |
Create and "send" message from a variable node fgn along a given edge. More... | |
bool | factorSend (goFGNode< T, Tfloat > *fgn, goSize_t parentIndex) |
Calculate outgoing message for a factor node in the max-sum algorithm. More... | |
bool | forwardPass (goFGNode< T, Tfloat > *node) |
bool | backwardPass (goFGNode< T, Tfloat > *node) |
Tfloat | maxsum (goFGNodeFactor< T, Tfloat > *factorNode, goFunctorBase1< Tfloat, const goMath::Vector< T > & > *f, goMath::Vector< T > &X, goSize_t i, goSize_t fixed_index, Tfloat currentMax, goMath::Vector< T > &maxX) |
Recursive max/sum for the max-sum algorithm. More... | |
bool | flooding (goFGNode< T, Tfloat > *startNode, goFactorGraph< T, Tfloat > &fg, goSize_t maxPasses=0) |
"Flooding" type scheme for graphs with loops. More... | |
virtual bool | action (goFGNode< T, Tfloat > *node) |
![]() | |
goDouble | sum (goFunctorBase1< Tfloat, const goMath::Vector< T > & > *f, goMath::Vector< T > &X, goSize_t i, goSize_t fixed_index) |
Recursive sum. More... | |
void | setValueCount (goSize_t c) |
goSize_t | getValueCount () const |
void | setDirection (Direction d) |
Direction | getDirection () const |
![]() | |
bool | breadthFirst (goFGNode< T, Tfloat > *root) |
BFS. More... | |
bool | breadthFirstTree (goFGNode< T, Tfloat > *root) |
bool | depthFirstRecursive (goFGNode< T, Tfloat > *root) |
bool | depthFirst (goFGNode< T, Tfloat > *root) |
bool | depthFirstTree (goFGNode< T, Tfloat > *root) |
Same as depthFirst(), plus fills parent fields in the nodes. More... | |
virtual bool | action (const goFGNode< T, Tfloat > *node) const |
Additional Inherited Members | |
![]() | |
enum | Direction { FORWARD, BACKWARD } |
The max-sum algorithm.
Kschischang, F.R. & Frey, B.J. Iterative Decoding of Compound Codes by Probability Propagation in Graphical Models IEEE Journal on Selected Areas in Communications, 1998, 16, 219-230
F.R. Kschischang; B.J. Frey & H. Loeliger Factor Graphs and the Sum-Product Algorithm IEEE Transactions on Information Theory, 2001, 47, 498-508
Bishop, C.M. Pattern Recognition and Machine Learning Springer, 2006
|
inline |
Calculate outgoing message for a factor node in the max-sum algorithm.
fgn | Factor node. |
parentIndex | Index into fgn->adj pointing to the "parent" link, i.e. the link where the message is sent to. |
|
inline |
"Flooding" type scheme for graphs with loops.
Uses a sort of flooding message passing schedule (not parallel, but driven by a queue of pending messages).
startNode | "Root" node. Does not serve any purpose as long as no backtracking is implemented. |
fg | Factor graph to work on. |
maxPasses | Maximal number of passes each node is allowed to send messages for. If 0 (default), the algorithm will terminate when no more messages are pending. If there are loops in the graph and maxPasses is 0, the algorithm will run indefinitely. |
|
inline |
Recursive max/sum for the max-sum algorithm.
Calculates with x being the variable with
fixed_index
, the other variables connected to
factorNode
, and the messages stored in the edges between the variable nodes and
factorNode
. The above term constitutes the messages for the max-sum algorithm.
factorNode | Factor node to calculate on. |
f | Functor of factorNode (usually, but can also be a different one). |
X | Input for f |
i | Current index into X we are summing over. |
fixed_index | Index into X of the variable that is held fixed (not summed over). |
currentMax | Current maximum – start with a value lower than all other occuring values. |
maxX | Maximising variable values – set by this function. |
|
inlinevirtual |
Run the max-sum algorithm.
fg | Factor graph to run the algorithm on. |
valueCount | The values of the variables are in the range [0,valueCount-1]. |
Implements goMessagePassing< T, Tfloat >.
|
inline |
Create and "send" message from a variable node fgn
along a given edge.
fgn | Variable node to send from. |
parentIndex | Index into fgn->adj of edge to send the message along (the other connected node is a variable and "receives" the message). |