TRF Language Model
|
hidden-random-field model More...
#include <hrf-model.h>
Public Member Functions | |
Model (Vocab *pv) | |
Model (Vocab *pv, int hlayer, int hnode, int maxlen) | |
void | Reset (Vocab *pv, int hlayer, int hnode, int maxlen) |
reset, the maxlen is the length excluding the beg/end symbols. More... | |
int | GetHnode () const |
get hidden node dimension More... | |
int | GetHiddenOrder () const |
Get HH mat order. More... | |
int | GetParamNum () const |
Get the total parameter number. More... | |
virtual void | SetParam (PValue *pParam) |
Set the parameters. More... | |
void | GetParam (PValue *pParam) |
Get the paremetre vector. More... | |
LogP | GetLogProb (Seq &seq, bool bNorm=true) |
calculate the probability More... | |
void | ReadT (const char *pfilename) |
Read Model. More... | |
void | WriteT (const char *pfilename) |
Write Model. More... | |
LogP | GetLogProb (VecShell< VocabID > &x, bool bNorm=true) |
[exact] calculate the probability of x More... | |
LogP | ClusterSum (Seq &seq, int nPos, int nOrder) |
[exact] Calculate the logP in each cluster. Only used for forward-backword algorithms ( class AlgNode) More... | |
LogP | HiddenClusterSum (Seq &seq, int nPos, int nOrder) |
[exact] Calculate the logp in each cluster. Only consinder the VH,CH,HH values, used in class AlgHidden More... | |
LogP | FeatClusterSum (trf::Seq &x, int nPos, int nOrder) |
[exact] Calculate the logp in each cluster. Only consinder the feature values More... | |
LogP | LayerClusterSum (Seq &seq, int nlayer, int nPos, int nOrder) |
[exact] Calculate the logp in each cluster. Only consinder the VH,CH,HH values on such layer More... | |
double | ExactNormalize (int nLen) |
[exact] Exact Normalization, return the logz of given length More... | |
void | ExactNormalize () |
[exact] Exact Normalization all the length More... | |
LogP | GetMarginalLogProb (int nLen, int nPos, Seq &sub, bool bNorm=true) |
[exact] Exactly calculate the marginal probability at position 'nPos' and with order 'nOrder' More... | |
void | GetNodeExp (double *pExp, Prob *pLenProb=NULL) |
[exact] sum_l { n_l/n * E_{p_l}[f] }: Exactly calculate the expectation over x and h More... | |
void | GetNodeExp (int nLen, double *pExp) |
[exact] E_{p_l}[f]: Exactly calculate the expectation over x and h for length nLen More... | |
void | GetNodeExp (int nLen, VecShell< double > featexp, Mat3dShell< double > VHexp, Mat3dShell< double > CHexp, Mat3dShell< double > HHexp, MatShell< double > Bexp) |
[exact] E_{p_l}[f]: Exactly calculate the expectation over x and h for length nLen More... | |
void | GetHiddenExp (VecShell< int > x, double *pExp) |
[exact] E_{p_l(h|x)}[f]: don't clean the pExp and directly add the new exp to pExp. More... | |
void | GetLayerExp (AlgLayer &fb, int nLayer, Mat3dShell< double > &VHexp, Mat3dShell< double > &CHexp, Mat3dShell< double > &HHexp, MatShell< double > &Bexp, LogP logz=0) |
[exact] called in GetHiddenExp. More... | |
void | Sample (Seq &seq) |
[sample] Perform one train-dimensional mixture sampling More... | |
void | LocalJump (Seq &seq) |
[sample] Local Jump - sample a new length More... | |
void | MarkovMove (Seq &seq) |
[sample] Markov Move - perform the gibbs sampling More... | |
LogP | ProposeLength (int nOld, int &nNew, bool bSample) |
[sample] Propose the length, using the variable m_matLenJump More... | |
LogP | ProposeH0 (VecShell< HValue > &hi, Seq &seq, int nPos, bool bSample) |
[sample] Propose the h_{i} at position i. Then return the propose probability Q(h_i|h_{other}) More... | |
LogP | ProposeC0 (VocabID &ci, Seq &seq, int nPos, bool bSample) |
[sample] Propose the c_{i} at position i. Then return the propose probability R(c_i|h_i,c_{other}) More... | |
void | ProposeHProbs (VecShell< LogP > &logps, Seq &seq, int nPos, bool bConsiderXandC=false) |
[sample] A reduced model only consinder HHmat(W) and VHmat(M) and CHmat(U). More... | |
void | ProposeCProbs (VecShell< LogP > &logps, Seq &seq, int nPos) |
[sample] Return the distribution of c_i at position nPos More... | |
LogP | GetReducedModelForH (Seq &seq, int nPos) |
[sample] A unnormalized reduced model. It only consindering the HH matrix (W) More... | |
LogP | GetReducedModelForC (Seq &seq, int nPos) |
[sample] A unnormalized reduced model to sample class c_i, consindering CH matrix(U) and class-ngram (lambda_c) More... | |
LogP | GetReducedModelForW (Seq &seq, int nPos) |
[sample] A unnormalized reduced model to sample word w_i, consindering VH matrix(M) and word-ngram (lambda_w) More... | |
LogP | GetConditionalProbForH (VecShell< HValue > &hi, VecShell< Prob > &probs) |
[sample] using the logprobs returned by ProposeHProb to calculate the logprob of hi. More... | |
LogP | GetMarginalProbOfC (Seq &seq, int nPos) |
[sample] Fixed h, given c_i, summate the probabilities of x_i, i.e. P(c_i) More... | |
void | SampleC (Seq &seq, int nPos) |
[sample] Sample the c_i at position nPos given h_i without x_i. More... | |
LogP | SampleW (Seq &seq, int nPos, bool bSample=true) |
[sample] Sample the w_i at position nPos More... | |
void | RandSeq (Seq &seq, int nLen=-1) |
Random init sequence, if nLen==-1, random the length also. More... | |
void | RandHidden (Seq &seq) |
Random init the hidden variables. More... | |
virtual LogP | SampleHAndCGivenX (Seq &seq, MatShell< HValue > *tagH=NULL) |
[sample] sample h given x using gibbs sampling. More... | |
int | EncodeNode (VocabID xi, VocabID ci, VecShell< HValue > &hi) |
encode the x_i and h_i at position i to a integer More... | |
void | EncodeNode (VecShell< int > &vn, Seq &seq, int nPos=0, int nDim=-1) |
encode the x and h to a integer sequence More... | |
void | DecodeNode (int n, VocabID &xi, VocabID &ci, VecShell< HValue > &hi) |
decode a integer to the x_i and h_i More... | |
void | DecodeNode (VecShell< int > &vn, Seq &seq, int nPos=0, int nDim=-1) |
decode several integer to a sequence More... | |
int | GetEncodeNodeLimit () const |
The encoded integer size. More... | |
int | EncodeHidden (VecShell< HValue > hi) |
encode the hidden vector h_i to a integer More... | |
void | DecodeHidden (int n, VecShell< HValue > hi) |
decode a integer to a hidden vector More... | |
void | DecodeHidden (VecShell< int > &vn, Mat< HValue > &h, int nPos=0, int nDim=-1) |
decoder several integer to a sequence More... | |
int | GetEncodeHiddenLimit () const |
The encoded integer size. More... | |
void | DecodeLayer (VecShell< int > &vn, Mat< HValue > &h, int layer, int nPos=0, int nDim=-1) |
decoder several integer to a sequence More... | |
int | GetEncodeLayerLimit () const |
The encoded integer size of one layer. More... | |
template<typename T > | |
void | BufMap (T *p, VecShell< T > &feat, Mat3dShell< T > &VH, Mat3dShell< T > &CH, Mat3dShell< T > &HH, MatShell< T > &Bias) |
Map a paremeter vector to each kinds of parameters. More... | |
void | FeatCount (Seq &seq, VecShell< double > featcount, Mat3dShell< double > VHcount, Mat3dShell< double > CHcount, Mat3dShell< double > HHcount, MatShell< double > Bcount, double dadd=1) |
Count the feature number in current sequence, and add to the result. More... | |
void | HiddenFeatCount (Seq &seq, Mat3dShell< double > VHcount, Mat3dShell< double > CHcount, Mat3dShell< double > HHcount, MatShell< double > Bcount, double dadd=1) |
Count the hidden features. More... | |
void | FeatCount (Seq &seq, VecShell< double > count, double dadd=1) |
Count the feature number in current sequence. More... | |
PValue | SumVHWeight (MatShell< PValue > m, VecShell< HValue > h) |
PValue | SumHHWeight (Mat3dShell< PValue > m, VecShell< HValue > h1, VecShell< HValue > h2) |
PValue | SumVHWeight (MatShell< PValue > m, VecShell< HValue > h, int layer) |
PValue | SumHHWeight (Mat3dShell< PValue > m, VecShell< HValue > h1, VecShell< HValue > h2, int layer) |
void | PerformSAMS (int nMinibatch, int tmax, int t0, int beta, double zgap=10) |
perform the SAMS to estimate the normalization constants zeta More... | |
LogP | GetLogProb_AIS (VecShell< VocabID > &x, int nChain=10, int nIntermediate=10000) |
perform AIS to esitmate the mariginal probabilities More... | |
LogP | GetLogProb_Gibbs (VecShell< VocabID > &x, int num=100) |
sample the best hidden and calculate the joint probability. More... | |
Public Member Functions inherited from trf::Model | |
Model (Vocab *pv) | |
constructor More... | |
Model (Vocab *pv, int maxlen) | |
constructor More... | |
~Model () | |
destructor More... | |
int | GetMaxLen () const |
Get max-len. More... | |
Vocab * | GetVocab () const |
Get Vocab. More... | |
int | GetMaxOrder () const |
Get maximum order. More... | |
int | GetParamNum () const |
Get parameter number. More... | |
void | Reset (Vocab *pv, int maxlen) |
reset, the maxlen is the length excluding the beg/end symbols. More... | |
void | GetParam (PValue *pValue) |
Get the paremetre vector. More... | |
void | SetPi (Prob *pPi) |
Set the pi. More... | |
template<typename T > | |
void | SetZeta (T *pzeta) |
Set updated zeta. More... | |
template<typename T > | |
void | GetZeta (T *pzeta) |
LogP | GetLogProb (Seq &seq, bool bNorm=true) |
calculate the probability More... | |
void | LoadFromCorpus (const char *pcorpus, const char *pfeatstyle, int nOrder) |
load ngram features from corpus More... | |
void | FeatCount (Seq &seq, double *pCount, double dadd=1.0) |
Count the feature number in a sequence. More... | |
void | ReadT (const char *pfilename) |
Read Model. More... | |
void | WriteT (const char *pfilename) |
Write Model. More... | |
LogP | ClusterSum (Seq &seq, int nPos, int nOrder) |
Read Binary. More... | |
void | GetNodeExp (int nLen, double *pExp) |
[exact] E_{p_l}[f]: Exactly calculate the expectation over x and h for length nLen More... | |
void | GetNodeExp (double *pExp, Prob *pLenProb=NULL) |
[exact] sum_l { n_l/n * E_{p_l}[f] }: Exactly calculate the expectation over x and h More... | |
void | Sample (Seq &seq) |
[sample] Perform one train-dimensional mixture sampling More... | |
void | LocalJump (Seq &seq) |
[sample] Local Jump - sample a new length More... | |
virtual void | MarkovMove (Seq &seq) |
[sample] Markov Move - perform the gibbs sampling More... | |
LogP | ProposeLength (int nOld, int &nNew, bool bSample) |
[sample] Propose the length, using the variable m_matLenJump More... | |
LogP | ProposeC0 (VocabID &ci, Seq &seq, int nPos, bool bSample) |
[sample] Propose the c_{i} at position i. Then return the propose probability R(c_i|h_i,c_{other}) More... | |
void | ProposeCProbs (VecShell< LogP > &logps, Seq &seq, int nPos) |
[sample] Return the propose distribution of c_i at position nPos More... | |
LogP | GetReducedModelForC (Seq &seq, int nPos) |
[sample] A unnormalized reduced model to sample class c_i. More... | |
LogP | GetReducedModelForW (Seq &seq, int nPos) |
[sample] A unnormalized reduced model to sample word w_i. More... | |
LogP | GetReducedModel (Seq &seq, int nPos) |
[sample] A unnormalized reduced depending on nPos. More... | |
LogP | GetMarginalProbOfC (Seq &seq, int nPos) |
[sample] given c_i, summate the probabilities of x_i, i.e. P(c_i) More... | |
void | SampleC (Seq &seq, int nPos) |
[sample] Sample the c_i at position nPos without x_i. More... | |
LogP | SampleX (Seq &seq, int nPos, bool bSample=true) |
[sample] Sample the x_i at position nPos More... | |
LogP | AISNormalize (int nLen, int nChain, int nInter) |
perform AIS to calculate the normalization constants, return the logz of given length More... | |
void | AISNormalize (int nLenMin, int nLenMax, int nChain, int nInter) |
Public Attributes | |
int | m_hlayer |
the number of hidden layer More... | |
int | m_hnode |
the number of hidden nodes More... | |
Mat3d< PValue > | m_m3dVH |
the weight between Word(V) and Hidden(H) More... | |
Mat3d< PValue > | m_m3dCH |
the weight between Class(C) and Hidden(H) More... | |
Mat3d< PValue > | m_m3dHH |
the weight between adjacent Hidden(H) More... | |
Mat< PValue > | m_matBias |
the bias for each value of Hidden(H) More... | |
int | m_nSampleHAccTimes |
sample H the acceptance times More... | |
int | m_nSampleHTotalTimes |
sample H the total times More... | |
int | m_nLenJumpAccTimes |
lenght jump the acceptance times More... | |
int | m_nLenJumpTotalTime |
Public Attributes inherited from trf::Model | |
Feat * | m_pFeat |
hash all the features More... | |
Vec< PValue > | m_value |
the value for each features More... | |
int | m_maxlen |
the maximum length of model, excluding <s> and </s>. The min-len = 1 More... | |
Vec< Prob > | m_pi |
the prior length distribution More... | |
Vec< LogP > | m_logz |
the normalization constants log Z_l More... | |
Vec< LogP > | m_zeta |
the estimated normalization constants (fix = 0) More... | |
Vocab * | m_pVocab |
Mat< Prob > | m_matLenJump |
[sample] used to propose a new length More... | |
int | m_maxSampleLen |
[sample] the maximum sample length, default = m_maxlen + 2 More... | |
int | m_nLenJumpAccTimes |
lenght jump the acceptance times More... | |
int | m_nLenJumpTotalTime |
total times of length jump More... | |
int | m_nSampleHAccTimes |
sample H the acceptance times More... | |
int | m_nSampleHTotalTimes |
Protected Attributes | |
AlgNode | m_nodeCal |
the forward-backward calculation for node (x and h) More... | |
Protected Attributes inherited from trf::Model | |
AlgNode | m_AlgNode |
the forward-backward calculation each node More... | |
hidden-random-field model
Definition at line 98 of file hrf-model.h.
|
inline |
Definition at line 112 of file hrf-model.h.
|
inline |
Definition at line 116 of file hrf-model.h.
|
inline |
Map a paremeter vector to each kinds of parameters.
Definition at line 256 of file hrf-model.h.
[exact] Calculate the logP in each cluster. Only used for forward-backword algorithms ( class AlgNode)
Definition at line 298 of file hrf-model.cpp.
decode a integer to a hidden vector
Definition at line 1152 of file hrf-model.cpp.
void hrf::Model::DecodeHidden | ( | VecShell< int > & | vn, |
Mat< HValue > & | h, | ||
int | nPos = 0 , |
||
int | nDim = -1 |
||
) |
decoder several integer to a sequence
Definition at line 1159 of file hrf-model.cpp.
void hrf::Model::DecodeLayer | ( | VecShell< int > & | vn, |
Mat< HValue > & | h, | ||
int | layer, | ||
int | nPos = 0 , |
||
int | nDim = -1 |
||
) |
decoder several integer to a sequence
Definition at line 1174 of file hrf-model.cpp.
decode a integer to the x_i and h_i
Definition at line 1124 of file hrf-model.cpp.
decode several integer to a sequence
Definition at line 1132 of file hrf-model.cpp.
encode the hidden vector h_i to a integer
Definition at line 1143 of file hrf-model.cpp.
encode the x_i and h_i at position i to a integer
Definition at line 1111 of file hrf-model.cpp.
encode the x and h to a integer sequence
Definition at line 1117 of file hrf-model.cpp.
|
virtual |
[exact] Exact Normalization, return the logz of given length
< max-order
Reimplemented from trf::Model.
Definition at line 403 of file hrf-model.cpp.
|
virtual |
[exact] Exact Normalization all the length
Reimplemented from trf::Model.
Definition at line 445 of file hrf-model.cpp.
[exact] Calculate the logp in each cluster. Only consinder the feature values
Definition at line 302 of file hrf-model.cpp.
void hrf::Model::FeatCount | ( | Seq & | seq, |
VecShell< double > | featcount, | ||
Mat3dShell< double > | VHcount, | ||
Mat3dShell< double > | CHcount, | ||
Mat3dShell< double > | HHcount, | ||
MatShell< double > | Bcount, | ||
double | dadd = 1 |
||
) |
Count the feature number in current sequence, and add to the result.
Definition at line 1186 of file hrf-model.cpp.
Count the feature number in current sequence.
Definition at line 1234 of file hrf-model.cpp.
[sample] using the logprobs returned by ProposeHProb to calculate the logprob of hi.
Definition at line 951 of file hrf-model.cpp.
int hrf::Model::GetEncodeHiddenLimit | ( | ) | const |
The encoded integer size.
Definition at line 1166 of file hrf-model.cpp.
int hrf::Model::GetEncodeLayerLimit | ( | ) | const |
The encoded integer size of one layer.
Definition at line 1181 of file hrf-model.cpp.
int hrf::Model::GetEncodeNodeLimit | ( | ) | const |
The encoded integer size.
Definition at line 1139 of file hrf-model.cpp.
void hrf::Model::GetHiddenExp | ( | VecShell< int > | x, |
double * | pExp | ||
) |
[exact] E_{p_l(h|x)}[f]: don't clean the pExp and directly add the new exp to pExp.
< length
< max-order
Definition at line 622 of file hrf-model.cpp.
|
inline |
Get HH mat order.
Definition at line 128 of file hrf-model.h.
|
inline |
get hidden node dimension
Definition at line 126 of file hrf-model.h.
void hrf::Model::GetLayerExp | ( | AlgLayer & | fb, |
int | nLayer, | ||
Mat3dShell< double > & | VHexp, | ||
Mat3dShell< double > & | CHexp, | ||
Mat3dShell< double > & | HHexp, | ||
MatShell< double > & | Bexp, | ||
LogP | logz = 0 |
||
) |
[exact] called in GetHiddenExp.
Definition at line 650 of file hrf-model.cpp.
calculate the probability
Definition at line 112 of file hrf-model.cpp.
[exact] calculate the probability of x
Add all the ngram features
Definition at line 277 of file hrf-model.cpp.
LogP hrf::Model::GetLogProb_AIS | ( | VecShell< VocabID > & | x, |
int | nChain = 10 , |
||
int | nIntermediate = 10000 |
||
) |
perform AIS to esitmate the mariginal probabilities
Definition at line 1342 of file hrf-model.cpp.
sample the best hidden and calculate the joint probability.
Definition at line 1470 of file hrf-model.cpp.
[exact] Exactly calculate the marginal probability at position 'nPos' and with order 'nOrder'
Definition at line 453 of file hrf-model.cpp.
[sample] Fixed h, given c_i, summate the probabilities of x_i, i.e. P(c_i)
Definition at line 961 of file hrf-model.cpp.
void hrf::Model::GetNodeExp | ( | double * | pExp, |
Prob * | pLenProb = NULL |
||
) |
[exact] sum_l { n_l/n * E_{p_l}[f] }: Exactly calculate the expectation over x and h
< max-order
Definition at line 470 of file hrf-model.cpp.
void hrf::Model::GetNodeExp | ( | int | nLen, |
double * | pExp | ||
) |
[exact] E_{p_l}[f]: Exactly calculate the expectation over x and h for length nLen
Definition at line 499 of file hrf-model.cpp.
void hrf::Model::GetNodeExp | ( | int | nLen, |
VecShell< double > | featexp, | ||
Mat3dShell< double > | VHexp, | ||
Mat3dShell< double > | CHexp, | ||
Mat3dShell< double > | HHexp, | ||
MatShell< double > | Bexp | ||
) |
[exact] E_{p_l}[f]: Exactly calculate the expectation over x and h for length nLen
decoder to x and h
Definition at line 507 of file hrf-model.cpp.
void hrf::Model::GetParam | ( | PValue * | pParam | ) |
Get the paremetre vector.
Definition at line 95 of file hrf-model.cpp.
|
inline |
Get the total parameter number.
Definition at line 130 of file hrf-model.h.
[sample] A unnormalized reduced model to sample class c_i, consindering CH matrix(U) and class-ngram (lambda_c)
Definition at line 927 of file hrf-model.cpp.
[sample] A unnormalized reduced model. It only consindering the HH matrix (W)
Definition at line 913 of file hrf-model.cpp.
[sample] A unnormalized reduced model to sample word w_i, consindering VH matrix(M) and word-ngram (lambda_w)
Definition at line 941 of file hrf-model.cpp.
[exact] Calculate the logp in each cluster. Only consinder the VH,CH,HH values, used in class AlgHidden
Definition at line 306 of file hrf-model.cpp.
void hrf::Model::HiddenFeatCount | ( | Seq & | seq, |
Mat3dShell< double > | VHcount, | ||
Mat3dShell< double > | CHcount, | ||
Mat3dShell< double > | HHcount, | ||
MatShell< double > | Bcount, | ||
double | dadd = 1 |
||
) |
Count the hidden features.
Definition at line 1194 of file hrf-model.cpp.
[exact] Calculate the logp in each cluster. Only consinder the VH,CH,HH values on such layer
Definition at line 355 of file hrf-model.cpp.
void hrf::Model::LocalJump | ( | Seq & | seq | ) |
[sample] Local Jump - sample a new length
Definition at line 730 of file hrf-model.cpp.
void hrf::Model::MarkovMove | ( | Seq & | seq | ) |
[sample] Markov Move - perform the gibbs sampling
Definition at line 777 of file hrf-model.cpp.
void hrf::Model::PerformSAMS | ( | int | nMinibatch, |
int | tmax, | ||
int | t0, | ||
int | beta, | ||
double | zgap = 10 |
||
) |
perform the SAMS to estimate the normalization constants zeta
< the length count of sample of each thread
Definition at line 1288 of file hrf-model.cpp.
[sample] Propose the c_{i} at position i. Then return the propose probability R(c_i|h_i,c_{other})
Definition at line 824 of file hrf-model.cpp.
[sample] Return the distribution of c_i at position nPos
Definition at line 903 of file hrf-model.cpp.
[sample] Propose the h_{i} at position i. Then return the propose probability Q(h_i|h_{other})
Definition at line 796 of file hrf-model.cpp.
void hrf::Model::ProposeHProbs | ( | VecShell< LogP > & | logps, |
Seq & | seq, | ||
int | nPos, | ||
bool | bConsiderXandC = false |
||
) |
[sample] A reduced model only consinder HHmat(W) and VHmat(M) and CHmat(U).
save the logp of 0 or 1 for each hidden vairables
Definition at line 841 of file hrf-model.cpp.
LogP hrf::Model::ProposeLength | ( | int | nOld, |
int & | nNew, | ||
bool | bSample | ||
) |
[sample] Propose the length, using the variable m_matLenJump
Definition at line 788 of file hrf-model.cpp.
void hrf::Model::RandHidden | ( | Seq & | seq | ) |
Random init the hidden variables.
Definition at line 1101 of file hrf-model.cpp.
void hrf::Model::RandSeq | ( | Seq & | seq, |
int | nLen = -1 |
||
) |
Random init sequence, if nLen==-1, random the length also.
Definition at line 1083 of file hrf-model.cpp.
void hrf::Model::ReadT | ( | const char * | pfilename | ) |
Read Model.
Definition at line 149 of file hrf-model.cpp.
void hrf::Model::Reset | ( | Vocab * | pv, |
int | hlayer, | ||
int | hnode, | ||
int | maxlen | ||
) |
reset, the maxlen is the length excluding the beg/end symbols.
Definition at line 65 of file hrf-model.cpp.
void hrf::Model::Sample | ( | Seq & | seq | ) |
[sample] Perform one train-dimensional mixture sampling
Definition at line 725 of file hrf-model.cpp.
void hrf::Model::SampleC | ( | Seq & | seq, |
int | nPos | ||
) |
[sample] Sample the c_i at position nPos given h_i without x_i.
Definition at line 979 of file hrf-model.cpp.
[sample] sample h given x using gibbs sampling.
Definition at line 1053 of file hrf-model.cpp.
[sample] Sample the w_i at position nPos
Definition at line 1012 of file hrf-model.cpp.
|
virtual |
PValue hrf::Model::SumHHWeight | ( | Mat3dShell< PValue > | m, |
VecShell< HValue > | h1, | ||
VecShell< HValue > | h2 | ||
) |
Definition at line 1251 of file hrf-model.cpp.
PValue hrf::Model::SumHHWeight | ( | Mat3dShell< PValue > | m, |
VecShell< HValue > | h1, | ||
VecShell< HValue > | h2, | ||
int | layer | ||
) |
Definition at line 1273 of file hrf-model.cpp.
Definition at line 1243 of file hrf-model.cpp.
Definition at line 1265 of file hrf-model.cpp.
void hrf::Model::WriteT | ( | const char * | pfilename | ) |
Write Model.
Definition at line 233 of file hrf-model.cpp.
int hrf::Model::m_hlayer |
the number of hidden layer
Definition at line 101 of file hrf-model.h.
int hrf::Model::m_hnode |
the number of hidden nodes
Definition at line 102 of file hrf-model.h.
the weight between Class(C) and Hidden(H)
Definition at line 104 of file hrf-model.h.
the weight between adjacent Hidden(H)
Definition at line 105 of file hrf-model.h.
the weight between Word(V) and Hidden(H)
Definition at line 103 of file hrf-model.h.
the bias for each value of Hidden(H)
Definition at line 106 of file hrf-model.h.
int hrf::Model::m_nLenJumpAccTimes |
lenght jump the acceptance times
Definition at line 179 of file hrf-model.h.
int hrf::Model::m_nLenJumpTotalTime |
total times of length jump
Definition at line 180 of file hrf-model.h.
|
protected |
the forward-backward calculation for node (x and h)
Definition at line 109 of file hrf-model.h.
int hrf::Model::m_nSampleHAccTimes |
sample H the acceptance times
Definition at line 177 of file hrf-model.h.
int hrf::Model::m_nSampleHTotalTimes |
sample H the total times
Definition at line 178 of file hrf-model.h.