TRF Language Model
trf::Algfb Class Referenceabstract

#include <trf-alg.h>

Inheritance diagram for trf::Algfb:
hrf::AlgLayer hrf::AlgNode trf::AlgNode

Public Member Functions

 Algfb ()
 
 ~Algfb ()
 
void Prepare (int nLen, int nOrder, int nValueLimit)
 prepare More...
 
void ForwardBackward (int nLen, int nOrder, int nValueLimit)
 forward-backward calculation More...
 
LogP GetMarginalLogProb (int nPos, int *pSubSeq, int nSubLen, double logz=0)
 Get the marginal probability. 'logz' is the input of the log normalization constants. More...
 
LogP GetLogSummation ()
 Get the summation over the sequence, corresponding to the log normalization constants 'logZ'. More...
 
virtual LogP ClusterSum (int *pSeq, int nLen, int nPos, int nOrder)=0
 This function need be derived. Calcualte the log probability of each cluster. More...
 

Public Attributes

int m_nOrder
 the order, i.e. the node number at each cluster {x_1,x_2,...,x_n} More...
 
int m_nLen
 the sequence length. More...
 
int m_nValueLimit
 the max-value at each position More...
 
Array< Msg * > m_aAlpha
 the forward message More...
 
Array< Msg * > m_aBeta
 the backward message More...
 

Detailed Description

Definition at line 34 of file trf-alg.h.

Constructor & Destructor Documentation

§ Algfb()

trf::Algfb::Algfb ( )
inline

Definition at line 44 of file trf-alg.h.

§ ~Algfb()

trf::Algfb::~Algfb ( )

Definition at line 22 of file trf-alg.cpp.

Member Function Documentation

§ ClusterSum()

virtual LogP trf::Algfb::ClusterSum ( int *  pSeq,
int  nLen,
int  nPos,
int  nOrder 
)
pure virtual

This function need be derived. Calcualte the log probability of each cluster.

Implemented in hrf::AlgLayer, hrf::AlgNode, and trf::AlgNode.

§ ForwardBackward()

void trf::Algfb::ForwardBackward ( int  nLen,
int  nOrder,
int  nValueLimit 
)

forward-backward calculation

the sequence.

Definition at line 54 of file trf-alg.cpp.

§ GetLogSummation()

LogP trf::Algfb::GetLogSummation ( )

Get the summation over the sequence, corresponding to the log normalization constants 'logZ'.

summation

Definition at line 155 of file trf-alg.cpp.

§ GetMarginalLogProb()

LogP trf::Algfb::GetMarginalLogProb ( int  nPos,
int *  pSubSeq,
int  nSubLen,
double  logz = 0 
)

Get the marginal probability. 'logz' is the input of the log normalization constants.

Definition at line 99 of file trf-alg.cpp.

§ Prepare()

void trf::Algfb::Prepare ( int  nLen,
int  nOrder,
int  nValueLimit 
)

prepare

Definition at line 31 of file trf-alg.cpp.

Member Data Documentation

§ m_aAlpha

Array<Msg*> trf::Algfb::m_aAlpha

the forward message

Definition at line 40 of file trf-alg.h.

§ m_aBeta

Array<Msg*> trf::Algfb::m_aBeta

the backward message

Definition at line 41 of file trf-alg.h.

§ m_nLen

int trf::Algfb::m_nLen

the sequence length.

Definition at line 38 of file trf-alg.h.

§ m_nOrder

int trf::Algfb::m_nOrder

the order, i.e. the node number at each cluster {x_1,x_2,...,x_n}

Definition at line 37 of file trf-alg.h.

§ m_nValueLimit

int trf::Algfb::m_nValueLimit

the max-value at each position

Definition at line 39 of file trf-alg.h.


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