Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cc.mallet.fst.semi_supervised
Class CRFOptimizableByGECriteria

    java.lang.Object
      cc.mallet.fst.semi_supervised.CRFOptimizableByGECriteria

All Implemented Interfaces:
  Optimizable, Optimizable.ByGradientValue, java.io.Serializable

    public class CRFOptimizableByGECriteria

extends java.lang.Object
implements Optimizable.ByGradientValue, java.io.Serializable

GE criteria for training a linear chain CRF.

Author:
  Gaurav Chandalia, Gregory Druck
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from interface cc.mallet.optimize.Optimizable
`Optimizable.ByBatchGradient, Optimizable.ByCombiningBatchGradient, Optimizable.ByGISUpdate, Optimizable.ByGradient, Optimizable.ByGradientValue, Optimizable.ByHessian, Optimizable.ByValue, Optimizable.ByVotedPerceptron`

Field Summary
`protected double[]` | `cachedGradient`
`protected double` | `cachedValue`
`protected CRF` | `crf`
`protected InstanceList` | `data`
`protected GECriteria` | `geCriteria`
`protected cc.mallet.fst.semi_supervised.CRFOptimizableByGECriteria.LatticeCreationExecutor` | `geLatticeExecutor`
`protected CRF.Factors` | `gradient`
`protected Transducer.Incrementor` | `incrementor`
`protected double` | `priorVariance`
`protected java.util.concurrent.ThreadPoolExecutor` | `sumLatticeExecutor`

Constructor Summary
`CRFOptimizableByGECriteria(GECriteria geCriteria, CRF crf, InstanceList ilist, int numThreads)` Initializes the structures.

Method Summary
`void` | `computeGradient(FeatureVectorSequence input, double[][] gammas, double[][][] xis)` Fills gradient from a single instance.
`void` | `computeGradient(java.util.Map<java.lang.Integer,SumLattice> lattices)` Resets, computes and fills gradient from all instances.
`GECriteria` | `getGECriteria()`
`int` | `getNumParameters()`
`double` | `getParameter(int index)`
`void` | `getParameters(double[] buffer)`
`double` | `getValue()`
`void` | `getValueGradient(double[] buffer)`
`void` | `initialize(java.util.Map<java.lang.Integer,SumLattice> lattices)` Initializes the gradient to zero and re-computes expectations for a new iteration.
`void` | `printGradientAbsNorm()`
`void` | `setGaussianPriorVariance(double priorVariance)`
`void` | `setParameter(int index, double value)`
`void` | `setParameters(double[] buffer)`
`void` | `shutdown()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### data

    protected InstanceList data

### crf

    protected CRF crf

### geCriteria

    protected GECriteria geCriteria

### gradient

    protected CRF.Factors gradient

### incrementor

    protected Transducer.Incrementor incrementor

### cachedValue

    protected double cachedValue

### cachedGradient

    protected double[] cachedGradient

### priorVariance

    protected double priorVariance

### geLatticeExecutor

    protected transient cc.mallet.fst.semi_supervised.CRFOptimizableByGECriteria.LatticeCreationExecutor geLatticeExecutor

### sumLatticeExecutor

    protected transient java.util.concurrent.ThreadPoolExecutor sumLatticeExecutor

Constructor Detail

### CRFOptimizableByGECriteria

    public CRFOptimizableByGECriteria(GECriteria geCriteria,
                                      CRF crf,
                                      InstanceList ilist,
                                      int numThreads)

  Initializes the structures.

  Parameters:
    `geCriteria` - GE criteria.
    `crf` - Model.
    `ilist` - Data used for training.

Method Detail

### shutdown

    public void shutdown()

### setGaussianPriorVariance

    public void setGaussianPriorVariance(double priorVariance)

### getGECriteria

    public GECriteria getGECriteria()

### initialize

    public void initialize(java.util.Map<java.lang.Integer,SumLattice> lattices)

  Initializes the gradient to zero and re-computes expectations for a new iteration.

  Also creates the executor to compute the gradient (if not done yet).

### computeGradient

    public void computeGradient(FeatureVectorSequence input,
                                double[][] gammas,
                                double[][][] xis)

  Fills gradient from a single instance.

### computeGradient

    public void computeGradient(java.util.Map<java.lang.Integer,SumLattice> lattices)

  Resets, computes and fills gradient from all instances.

  Analogous to `CRFOptimizableByLabelLikelihood.getExpectationValue`.``

### getValue

    public double getValue()

  Specified by:
    `getValue` in interface `Optimizable.ByGradientValue`

### getValueGradient

    public void getValueGradient(double[] buffer)

  Specified by:
    `getValueGradient` in interface `Optimizable.ByGradientValue`

### printGradientAbsNorm

    public void printGradientAbsNorm()

### getNumParameters

    public int getNumParameters()

  Specified by:
    `getNumParameters` in interface `Optimizable`

### getParameters

    public void getParameters(double[] buffer)

  Specified by:
    `getParameters` in interface `Optimizable`

### setParameters

    public void setParameters(double[] buffer)

  Specified by:
    `setParameters` in interface `Optimizable`

### getParameter

    public double getParameter(int index)

  Specified by:
    `getParameter` in interface `Optimizable`

### setParameter

    public void setParameter(int index,
                             double value)

  Specified by:
    `setParameter` in interface `Optimizable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD