mdiadaptlm Class Reference

#include <mdiadapt.h>

Inheritance diagram for mdiadaptlm:

Inheritance graph
[legend]
Collaboration diagram for mdiadaptlm:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 mdiadaptlm (char *ngtfile, int depth=0, TABLETYPE tt=FULL)
normcacheget_zetacache ()
NGRAMCACHE_t * get_probcache (int level)
NGRAMCACHE_t * get_backoffcache (int level)
void create_caches (int mcl)
void init_caches ()
void init_caches (int level)
void delete_caches ()
void delete_caches (int level)
void check_cache_levels ()
void check_cache_levels (int level)
void reset_caches ()
void reset_caches (int level)
void caches_stat ()
double zeta (ngram ng, int size)
int discount (ngram ng, int size, double &fstar, double &lambda, int cv=0)
int bodiscount (ngram ng, int size, double &fstar, double &lambda, double &bo)
int compute_backoff ()
int compute_backoff_per_level ()
int compute_backoff_per_word ()
double backunig (ngram ng)
double foreunig (ngram ng)
int adapt (char *ngtfile, int alev=1, double gis_step=0.4)
int scalefact (char *ngtfile)
int savescalefactor (char *filename)
double scalefact (ngram ng)
double prob (ngram ng, int size)
double prob (ngram ng, int size, double &fstar, double &lambda, double &bo)
double prob2 (ngram ng, int size, double &fstar)
double txclprob (ngram ng, int size)
int saveASR (char *filename, int backoff, char *subdictfile=NULL)
int saveMT (char *filename, int backoff, char *subdictfile=NULL, int resolution=10000000, double decay=0.999900)
int saveARPA (char *filename, int backoff=0, char *subdictfile=NULL)
int saveBIN (char *filename, int backoff=0, char *subdictfile=NULL, int mmap=0)
void save_per_level (bool value)
bool save_per_level ()
int netsize ()
 ~mdiadaptlm ()
double myround (double x)
bool is_train_cache_enabled ()

Public Attributes

double gis_step

Protected Member Functions

int saveARPA_per_word (char *filename, int backoff=0, char *subdictfile=NULL)
int saveARPA_per_level (char *filename, int backoff=0, char *subdictfile=NULL)
int saveBIN_per_word (char *filename, int backoff=0, char *subdictfile=NULL, int mmap=0)
int saveBIN_per_level (char *filename, int backoff=0, char *subdictfile=NULL, int mmap=0)

Protected Attributes

normcachecache
NGRAMCACHE_t ** probcache
NGRAMCACHE_t ** backoffcache
int max_caching_level


Detailed Description

Definition at line 30 of file mdiadapt.h.


Constructor & Destructor Documentation

mdiadaptlm::mdiadaptlm ( char *  ngtfile,
int  depth = 0,
TABLETYPE  tt = FULL 
)

Definition at line 44 of file mdiadapt.cpp.

References cache, and NULL.

mdiadaptlm::~mdiadaptlm (  ) 

Definition at line 53 of file mdiadapt.cpp.

References cache, and delete_caches().

Here is the call graph for this function:


Member Function Documentation

int mdiadaptlm::adapt ( char *  ngtfile,
int  alev = 1,
double  gis_step = 0.4 
)

Definition at line 250 of file mdiadapt.cpp.

References backunig(), ngramtable::dict, gis_step, interplm::lmsize(), NULL, scalefact(), dictionary::size(), ngram::wordp(), and zeta().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

double mdiadaptlm::backunig ( ngram  ng  ) 

Definition at line 238 of file mdiadapt.cpp.

References discount().

Referenced by adapt(), and scalefact().

Here is the call graph for this function:

Here is the caller graph for this function:

int mdiadaptlm::bodiscount ( ngram  ng,
int  size,
double &  fstar,
double &  lambda,
double &  bo 
)

Definition at line 538 of file mdiadapt.cpp.

References interplm::backoff, ngramtable::boff(), ngramtable::dict, discount(), ngram::link, and ngram::trans().

Referenced by prob(), saveARPA_per_level(), saveARPA_per_word(), saveASR(), saveBIN_per_level(), saveBIN_per_word(), and saveMT().

Here is the call graph for this function:

Here is the caller graph for this function:

void mdiadaptlm::caches_stat (  ) 

Definition at line 75 of file mdiadapt.cpp.

References backoffcache, interplm::lmsize(), max_caching_level, and probcache.

Here is the call graph for this function:

void mdiadaptlm::check_cache_levels ( int  level  ) 

Definition at line 122 of file mdiadapt.cpp.

References backoffcache, and probcache.

void mdiadaptlm::check_cache_levels (  ) 

Definition at line 128 of file mdiadapt.cpp.

References max_caching_level.

int mdiadaptlm::compute_backoff (  )  [inline]

Definition at line 82 of file mdiadapt.h.

References compute_backoff_per_level(), and compute_backoff_per_word().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int mdiadaptlm::compute_backoff_per_level (  ) 

Definition at line 409 of file mdiadapt.cpp.

References interplm::backoff, ngramtable::boff(), CONT, ngramtable::dict, discount(), INIT, ngram::link, interplm::lmsize(), prob(), ngram::pushc(), ngramtable::scan(), ngram::size, and ngramtable::succscan().

Referenced by compute_backoff().

Here is the call graph for this function:

Here is the caller graph for this function:

int mdiadaptlm::compute_backoff_per_word (  ) 

Definition at line 453 of file mdiadapt.cpp.

Referenced by compute_backoff().

Here is the caller graph for this function:

void mdiadaptlm::create_caches ( int  mcl  ) 

Definition at line 92 of file mdiadapt.cpp.

References backoffcache, init_caches(), interplm::lmsize(), max_caching_level, NGRAMCACHE_t, NULL, and probcache.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void mdiadaptlm::delete_caches ( int  level  ) 

Definition at line 59 of file mdiadapt.cpp.

References backoffcache, and probcache.

void mdiadaptlm::delete_caches (  ) 

Definition at line 65 of file mdiadapt.cpp.

References backoffcache, max_caching_level, and probcache.

Referenced by ~mdiadaptlm().

Here is the caller graph for this function:

int mdiadaptlm::discount ( ngram  ng,
int  size,
double &  fstar,
double &  lambda,
int  cv = 0 
) [virtual]

Reimplemented from interplm.

Reimplemented in linearwb, mixture, shiftone, shiftbeta, symshiftbeta, and mshiftbeta.

Definition at line 349 of file mdiadapt.cpp.

References backoffcache, ngramtable::dict, max_caching_level, scalefact(), ngram::shift(), ngram::size, ngram::trans(), ngram::wordp(), and zeta().

Referenced by backunig(), bodiscount(), compute_backoff_per_level(), netsize(), prob2(), saveASR(), saveMT(), txclprob(), and zeta().

Here is the call graph for this function:

Here is the caller graph for this function:

double mdiadaptlm::foreunig ( ngram  ng  ) 

Definition at line 228 of file mdiadapt.cpp.

References interplm::discount().

Referenced by scalefact().

Here is the call graph for this function:

Here is the caller graph for this function:

NGRAMCACHE_t * mdiadaptlm::get_backoffcache ( int  level  )  [inline]

Definition at line 154 of file mdiadapt.cpp.

References backoffcache.

NGRAMCACHE_t * mdiadaptlm::get_probcache ( int  level  )  [inline]

Definition at line 149 of file mdiadapt.cpp.

References probcache.

normcache* mdiadaptlm::get_zetacache (  )  [inline]

Definition at line 55 of file mdiadapt.h.

References cache.

void mdiadaptlm::init_caches ( int  level  ) 

Definition at line 107 of file mdiadapt.cpp.

References backoffcache, NGRAMCACHE_t, NULL, and probcache.

void mdiadaptlm::init_caches (  ) 

Definition at line 115 of file mdiadapt.cpp.

References max_caching_level.

Referenced by create_caches().

Here is the caller graph for this function:

bool mdiadaptlm::is_train_cache_enabled (  )  [inline]

Definition at line 150 of file mdiadapt.h.

Referenced by main().

Here is the caller graph for this function:

double mdiadaptlm::myround ( double  x  )  [inline]

Reimplemented from ngramtable.

Definition at line 145 of file mdiadapt.h.

int mdiadaptlm::netsize (  )  [virtual]

Reimplemented from interplm.

Definition at line 591 of file mdiadapt.cpp.

References CONT, ngramtable::dict, discount(), INIT, ngramtable::maxlevel(), ngramtable::scan(), and dictionary::size().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

double mdiadaptlm::prob ( ngram  ng,
int  size,
double &  fstar,
double &  lambda,
double &  bo 
)

Definition at line 483 of file mdiadapt.cpp.

References interplm::backoff, bodiscount(), max_caching_level, prob(), probcache, ngram::size, UPPER_SINGLE_PRECISION_OF_1, and ngram::wordp().

Here is the call graph for this function:

double mdiadaptlm::prob ( ngram  ng,
int  size 
) [virtual]

Reimplemented from interplm.

Definition at line 477 of file mdiadapt.cpp.

Referenced by compute_backoff_per_level(), main(), prob(), prob2(), saveARPA_per_level(), saveARPA_per_word(), saveASR(), saveBIN_per_level(), saveBIN_per_word(), saveMT(), and mixture::train().

Here is the caller graph for this function:

double mdiadaptlm::prob2 ( ngram  ng,
int  size,
double &  fstar 
)

Definition at line 462 of file mdiadapt.cpp.

References discount(), and prob().

Here is the call graph for this function:

void mdiadaptlm::reset_caches ( int  level  ) 

Definition at line 135 of file mdiadapt.cpp.

References backoffcache, MAX, and probcache.

void mdiadaptlm::reset_caches (  ) 

Definition at line 141 of file mdiadapt.cpp.

References max_caching_level.

bool mdiadaptlm::save_per_level (  )  [inline]

Definition at line 139 of file mdiadapt.h.

void mdiadaptlm::save_per_level ( bool  value  )  [inline]

Definition at line 138 of file mdiadapt.h.

Referenced by main().

Here is the caller graph for this function:

int mdiadaptlm::saveARPA ( char *  filename,
int  backoff = 0,
char *  subdictfile = NULL 
) [inline]

Definition at line 119 of file mdiadapt.h.

References interplm::backoff, saveARPA_per_level(), and saveARPA_per_word().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int mdiadaptlm::saveARPA_per_level ( char *  filename,
int  backoff = 0,
char *  subdictfile = NULL 
) [protected]

int mdiadaptlm::saveARPA_per_word ( char *  filename,
int  backoff = 0,
char *  subdictfile = NULL 
) [protected]

int mdiadaptlm::saveASR ( char *  filename,
int  backoff,
char *  subdictfile = NULL 
)

int mdiadaptlm::saveBIN ( char *  filename,
int  backoff = 0,
char *  subdictfile = NULL,
int  mmap = 0 
) [inline]

Definition at line 128 of file mdiadapt.h.

References interplm::backoff, saveBIN_per_level(), and saveBIN_per_word().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

int mdiadaptlm::saveBIN_per_level ( char *  filename,
int  backoff = 0,
char *  subdictfile = NULL,
int  mmap = 0 
) [protected]

int mdiadaptlm::saveBIN_per_word ( char *  filename,
int  backoff = 0,
char *  subdictfile = NULL,
int  mmap = 0 
) [protected]

int mdiadaptlm::saveMT ( char *  filename,
int  backoff,
char *  subdictfile = NULL,
int  resolution = 10000000,
double  decay = 0.999900 
)

int mdiadaptlm::savescalefactor ( char *  filename  ) 

Definition at line 190 of file mdiadapt.cpp.

References dictionary::decode(), ngramtable::dict, dictionary::oovcode(), scalefact(), dictionary::size(), and ngram::wordp().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

double mdiadaptlm::scalefact ( ngram  ng  ) 

Definition at line 214 of file mdiadapt.cpp.

References backunig(), ngramtable::dict, foreunig(), gis_step, dictionary::oovcode(), ngram::trans(), and ngram::wordp().

Here is the call graph for this function:

int mdiadaptlm::scalefact ( char *  ngtfile  ) 

Definition at line 159 of file mdiadapt.cpp.

References backunig(), cache, ngramtable::dict, foreunig(), NULL, dictionary::oovcode(), dictionary::size(), interplm::train(), ngram::trans(), and ngram::wordp().

Referenced by adapt(), discount(), savescalefactor(), and zeta().

Here is the call graph for this function:

Here is the caller graph for this function:

double mdiadaptlm::txclprob ( ngram  ng,
int  size 
)

double mdiadaptlm::zeta ( ngram  ng,
int  size 
)

Definition at line 300 of file mdiadapt.cpp.

References cache, CONT, discount(), INIT, normcache::put(), scalefact(), ngram::size, and ngramtable::succscan().

Referenced by adapt(), and discount().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

NGRAMCACHE_t** mdiadaptlm::backoffcache [protected]

Definition at line 40 of file mdiadapt.h.

Referenced by get_zetacache(), mdiadaptlm(), scalefact(), zeta(), and ~mdiadaptlm().

Definition at line 74 of file mdiadapt.h.

Referenced by adapt(), and scalefact().

NGRAMCACHE_t** mdiadaptlm::probcache [protected]


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

Generated on Thu Jul 6 00:31:51 2017 for Moses by  doxygen 1.5.9