edu.stanford.nlp.maxent
Class CGRunner

java.lang.Object
  extended by edu.stanford.nlp.maxent.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.

Author:
Kristina Toutanova, Christopher Manning

Constructor Summary
CGRunner(LambdaSolve prob, String filename)
          Set up a LambdaSolve problem for solution by Conjugate Gradient.
CGRunner(LambdaSolve prob, String filename, double priorSigmaS)
          Set up a LambdaSolve problem for solution by Conjugate Gradient, specifying a value for sigma2.
CGRunner(LambdaSolve prob, String filename, double tol, boolean useGaussianPrior, double priorSigmaS)
          Set up a LambdaSolve problem for solution by Conjugate Gradient.
CGRunner(LambdaSolve prob, String filename, double tol, boolean useGaussianPrior, double[] sigmaSquareds)
          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 priorSigmaS)
Set up a LambdaSolve problem for solution by Conjugate Gradient, specifying a value for sigma2.

Parameters:
prob - The problem to solve
filename - Used (with extension) to save intermediate results.
priorSigmaS - The prior sigma2: this doubled will be used to divide the lambda2 values as the prior penalty in the likelihood.

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

CGRunner

public CGRunner(LambdaSolve prob,
                String filename,
                double tol,
                boolean useGaussianPrior,
                double[] sigmaSquareds)
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
sigmaSquareds - 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