Joshua
open source statistical hierarchical phrase-based machine translation system
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
joshua.decoder.hypergraph.DefaultInsideOutside Class Reference
Inheritance diagram for joshua.decoder.hypergraph.DefaultInsideOutside:
[legend]
Collaboration diagram for joshua.decoder.hypergraph.DefaultInsideOutside:
[legend]

List of all members.

Public Member Functions

void runInsideOutside (HyperGraph hg, int add_mode, int semiring, double scaling_factor_)
void clearState ()
double getLogNormalizationConstant ()
double getEdgeUnormalizedPosteriorLogProb (HyperEdge dt, HGNode parent)
double getEdgePosteriorProb (HyperEdge dt, HGNode parent)
double getNodeUnnormalizedPosteriorLogProb (HGNode node)
double getNodePosteriorProb (HGNode node)
void sanityCheckHG (HyperGraph hg)

Protected Member Functions

abstract double getHyperedgeLogProb (HyperEdge dt, HGNode parent_it)
double getHyperedgeLogProb (HyperEdge dt, HGNode parent_it, double scaling_factor)

Package Attributes

int ADD_MODE = 0
int LOG_SEMIRING = 1
int SEMIRING = LOG_SEMIRING
double ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY
double ONE_IN_SEMIRING = 0
double scaling_factor
double normalizationConstant = ONE_IN_SEMIRING

Private Member Functions

void sanity_check_item (HGNode it)
void sanity_check_deduction (HyperEdge dt)
void inside_estimation_hg (HyperGraph hg)
double inside_estimation_item (HGNode it)
double inside_estimation_deduction (HyperEdge dt, HGNode parent_item)
void outside_estimation_hg (HyperGraph hg)
void outside_estimation_item (HGNode cur_it, HGNode upper_item, HyperEdge parent_dt, double parent_deduct_prob)
void outside_estimation_deduction (HyperEdge dt, HGNode parent_item)
void setup_semiring (int semiring, int add_mode)
double multi_in_semiring (double x, double y)
double add_in_semiring (double x, double y)
double multi_in_log_semiring (double x, double y)
double add_in_log_semiring (double x, double y)

Private Attributes

HashMap< HGNode, Double > tbl_inside_prob = new HashMap<HGNode, Double>()
HashMap< HGNode, Double > tbl_outside_prob = new HashMap<HGNode, Double>()
HashMap< HGNode, Integer > tbl_num_parent_deductions = new HashMap<HGNode, Integer>()
HashMap< HGNode, Integer > tbl_for_sanity_check = null

Detailed Description

to use the functions here, one need to extend the class to provide a way to calculate the transitionLogP based on feature set

Author:
Zhifei Li, zhife.nosp@m.i.wo.nosp@m.rk@gm.nosp@m.ail..nosp@m.com
Version:
$LastChangedDate$

Member Function Documentation

double joshua.decoder.hypergraph.DefaultInsideOutside.add_in_log_semiring ( double  x,
double  y 
) [private]

Here is the caller graph for this function:

double joshua.decoder.hypergraph.DefaultInsideOutside.add_in_semiring ( double  x,
double  y 
) [private]

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

abstract double joshua.decoder.hypergraph.DefaultInsideOutside.getHyperedgeLogProb ( HyperEdge  dt,
HGNode  parent_it 
) [protected, pure virtual]

Implemented in joshua.decoder.hypergraph.TrivialInsideOutside.

Here is the caller graph for this function:

double joshua.decoder.hypergraph.DefaultInsideOutside.getHyperedgeLogProb ( HyperEdge  dt,
HGNode  parent_it,
double  scaling_factor 
) [protected]

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

double joshua.decoder.hypergraph.DefaultInsideOutside.multi_in_log_semiring ( double  x,
double  y 
) [private]

Here is the caller graph for this function:

double joshua.decoder.hypergraph.DefaultInsideOutside.multi_in_semiring ( double  x,
double  y 
) [private]

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.hypergraph.DefaultInsideOutside.outside_estimation_item ( HGNode  cur_it,
HGNode  upper_item,
HyperEdge  parent_dt,
double  parent_deduct_prob 
) [private]

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.hypergraph.DefaultInsideOutside.runInsideOutside ( HyperGraph  hg,
int  add_mode,
int  semiring,
double  scaling_factor_ 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

Here is the call graph for this function:

Here is the caller graph for this function:

void joshua.decoder.hypergraph.DefaultInsideOutside.setup_semiring ( int  semiring,
int  add_mode 
) [private]

Here is the caller graph for this function:


Member Data Documentation

Two operations: add and multi add: different hyperedges lead to a specific item multi: prob of a derivation is a multi of all constituents

HashMap<HGNode, Double> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_inside_prob = new HashMap<HGNode, Double>() [private]
HashMap<HGNode, Integer> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_num_parent_deductions = new HashMap<HGNode, Integer>() [private]

for each item, remember how many deductions pointering to me, this is needed for outside estimation during outside estimation, an item will recursive call its deductions to do outside-estimation only after it itself is done with outside estimation, this is necessary because the outside estimation of the items under its deductions require the item's outside value

HashMap<HGNode, Double> joshua.decoder.hypergraph.DefaultInsideOutside.tbl_outside_prob = new HashMap<HGNode, Double>() [private]
double joshua.decoder.hypergraph.DefaultInsideOutside.ZERO_IN_SEMIRING = Double.NEGATIVE_INFINITY [package]