ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Private Attributes | List of all members
meta::sequence::forward_trellis Class Reference

Special trellis for the normalized forward algorithm. More...

#include <trellis.h>

Inheritance diagram for meta::sequence::forward_trellis:
meta::sequence::trellis

Public Member Functions

 forward_trellis (uint64_t size, uint64_t labels)
 Constructs a forward_trellis with the given number of time steps and labels. More...
 
double normalizer (uint64_t idx) const
 
void normalize (uint64_t idx)
 Performs normalization on the given time step and stores the normalizer. More...
 
- Public Member Functions inherited from meta::sequence::trellis
 trellis (uint64_t size, uint64_t labels)
 Constructs a new trellis with the given number of time steps and labels. More...
 
uint64_t size () const
 
void probability (uint64_t idx, const label_id &tag, double prob)
 Sets the value in the trellis for the given time step and label. More...
 
double probability (uint64_t idx, const label_id &tag) const
 Obtains the value in the trellis for the given time step and label. More...
 

Private Attributes

std::vector< double > normalizers_
 storage for the normalizers for each time step
 

Additional Inherited Members

- Protected Attributes inherited from meta::sequence::trellis
util::dense_matrix< double > trellis_
 storage for the scores
 

Detailed Description

Special trellis for the normalized forward algorithm.

In addition to storing the scores like a normal trellis, it also stores the normalizers (and can perform normalization on a given time step).

Constructor & Destructor Documentation

meta::sequence::forward_trellis::forward_trellis ( uint64_t  size,
uint64_t  labels 
)

Constructs a forward_trellis with the given number of time steps and labels.

Parameters
sizeThe number of time steps
labelsThe number of labels

Member Function Documentation

double meta::sequence::forward_trellis::normalizer ( uint64_t  idx) const
Parameters
idxThe time step
Returns
the normalizer used for the given time step
void meta::sequence::forward_trellis::normalize ( uint64_t  idx)

Performs normalization on the given time step and stores the normalizer.

Parameters
idxThe time step

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