ostore.oil
Class HMM.Delta

java.lang.Object
  |
  +--ostore.oil.HMM.Delta
All Implemented Interfaces:
Model.Delta, QueueElementIF, QuickSerializable
Enclosing class:
HMM

public static class HMM.Delta
extends Object
implements Model.Delta

A HMM.Delta object contains a diff of the sufficient statistics for an HMM.

Version:
$Id: HMM.java,v 1.24 2002/01/08 18:24:18 geels Exp $
Author:
Dennis Geels

Field Summary
 Matrix emissions
          Estimated count of state-output emissions.
 Array marginals
          Estimated marginal counts for each state.
 QSVector states
          The set of states referenced in the sufficient statistics.
 Matrix transitions
          Estimated count of state-state transitions.
 
Constructor Summary
HMM.Delta(byte[] data, int[] offset)
          Construct a Delta from its QuickSerializable form.
HMM.Delta(QSVector states, Array marginals, Matrix transitions, Matrix emissions)
          Constructs a Delta with the specified HMM data.
 
Method Summary
 Model.Delta sum(Model.Delta other)
          Produce the sum of this and another Delta.
 void to_bytes(byte[] data, int[] offset)
          We store the statistics using compression maps for both the states and the outputs.
 int type_code()
          Returns the unique integer associated with this class in the TypeTable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

states

public QSVector states
The set of states referenced in the sufficient statistics. The order is unimportant.

marginals

public Array marginals
Estimated marginal counts for each state.

transitions

public Matrix transitions
Estimated count of state-state transitions.

emissions

public Matrix emissions
Estimated count of state-output emissions.
Constructor Detail

HMM.Delta

public HMM.Delta(QSVector states,
                 Array marginals,
                 Matrix transitions,
                 Matrix emissions)
Constructs a Delta with the specified HMM data. The statistics should only contain entries for the specified states.
Parameters:
states - The set of states contained in this Delta
marginals - A QuickSerializable->double mapping from states to their marginal sufficient statistic.
transitions - A QuickSerializable->Array mapping from states to their transition sufficient statistics.
emissions - A QuickSerializable->Array mapping from states to their emission sufficient statistics.

HMM.Delta

public HMM.Delta(byte[] data,
                 int[] offset)
          throws QSException
Construct a Delta from its QuickSerializable form. See to_bytes(byte[], int[]).
Method Detail

sum

public Model.Delta sum(Model.Delta other)
Description copied from interface: Model.Delta
Produce the sum of this and another Delta.
Specified by:
sum in interface Model.Delta
Following copied from interface: ostore.oil.Model.Delta
Parameters:
other - The other Delta.
Returns:
a new Delta, constructed such that applying it to a Model produces an equivalent Model to that produced by adding first this, then other.
Throws:
IllegalArgumentException - if other is not an instance of a compatible Delta subclass.

to_bytes

public void to_bytes(byte[] data,
                     int[] offset)
We store the statistics using compression maps for both the states and the outputs. We store these maps last, but insert their offset into the beginning of the array.
Specified by:
to_bytes in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Parameters:
data - The byte array to store into, or null.
offset - A single element array whose first element is the index in data to begin writing at on function entry, and which on function exit has been incremented by the number of bytes written.

type_code

public int type_code()
Description copied from interface: QuickSerializable
Returns the unique integer associated with this class in the TypeTable.
Specified by:
type_code in interface QuickSerializable
Following copied from interface: ostore.util.QuickSerializable
Returns:
an integer unique to this class