edu.stanford.nlp.maxent.iis
Class CGRunner

java.lang.Object
  |
  +--edu.stanford.nlp.maxent.iis.CGRunner

public class CGRunner
extends Object

This class will call Conjugate Gradient on a LambdaSolve object to find optimal parameters, including imposing a Gaussian prior on those parameters.


Constructor Summary
CGRunner(LambdaSolve prob, String filename)
          Set up a LambdaSolve problem for solution by Conjugate Gradient.
CGRunner(LambdaSolve prob, String filename, double tol, boolean useGaussianPrior, double priorSigmaS)
          Set up a LambdaSolve problem for solution by Conjugate Gradient.
 
Method Summary
 void solve()
          Solves the problem using CG.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CGRunner

public CGRunner(LambdaSolve prob,
                String filename)
Set up a LambdaSolve problem for solution by Conjugate Gradient. Uses a Gaussian prior with a sigma2 of 0.5.

Parameters:
prob - The problem to solve
filename - Used (with extension) to save intermediate results.

CGRunner

public CGRunner(LambdaSolve prob,
                String filename,
                double tol,
                boolean useGaussianPrior,
                double priorSigmaS)
Set up a LambdaSolve problem for solution by Conjugate Gradient.

Parameters:
prob - The problem to solve
filename - Used (with extension) to save intermediate results.
tol - Tolerance of errors (passed to CG)
useGaussianPrior - True if parameters should be penalized with a gaussian prior for smoothing
priorSigmaS - The prior sigma2: this doubled will be used to divide the lambda2 values as the prior penalty
Method Detail

solve

public void solve()
Solves the problem using CG. The solution is stored in the lambda array of prob.



Stanford NLP Group