jsvmstruct
Class LearningProblem<PatternType,LabelType>

java.lang.Object
  extended by jsvmstruct.LearningProblem<PatternType,LabelType>

public abstract class LearningProblem<PatternType,LabelType>
extends Object


Field Summary
protected  StructModel structModel
           
protected  StructLearnParam structParams
           
 
Constructor Summary
LearningProblem()
           
 
Method Summary
abstract  LabelType classifyStructExample(PatternType x)
           
abstract  LabelType findMostViolatedConstraint(PatternType x, LabelType y)
           
 Constraint[] initStructConstraints()
           
abstract  void initStructModel(Example<PatternType,LabelType>[] sample)
           
 double loss(LabelType y, LabelType ybar)
           
 void parseStructParameters()
           
 void printStructHelp()
           
 void printStructLearningStats(Example<PatternType,LabelType>[] sample, Constraint[] cset, double[] alpha)
           
abstract  FeatureVector psi(PatternType x, LabelType y)
           
abstract  Example<PatternType,LabelType>[] readStructExamples(String filename)
           
 StructModel readStructModel(String file)
           
 void test(String[] argv)
           
 void writeStructModel(String file)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

structParams

protected StructLearnParam structParams

structModel

protected StructModel structModel
Constructor Detail

LearningProblem

public LearningProblem()
Method Detail

readStructExamples

public abstract Example<PatternType,LabelType>[] readStructExamples(String filename)
                                                             throws Throwable
Throws:
Throwable

initStructModel

public abstract void initStructModel(Example<PatternType,LabelType>[] sample)
                              throws Throwable
Throws:
Throwable

initStructConstraints

public Constraint[] initStructConstraints()
                                   throws Throwable
Throws:
Throwable

classifyStructExample

public abstract LabelType classifyStructExample(PatternType x)
                                         throws Throwable
Throws:
Throwable

findMostViolatedConstraint

public abstract LabelType findMostViolatedConstraint(PatternType x,
                                                     LabelType y)
                                              throws Throwable
Throws:
Throwable

psi

public abstract FeatureVector psi(PatternType x,
                                  LabelType y)
                           throws Throwable
Throws:
Throwable

loss

public double loss(LabelType y,
                   LabelType ybar)
            throws Throwable
Throws:
Throwable

printStructLearningStats

public void printStructLearningStats(Example<PatternType,LabelType>[] sample,
                                     Constraint[] cset,
                                     double[] alpha)
                              throws Throwable
Throws:
Throwable

writeStructModel

public void writeStructModel(String file)
                      throws Throwable
Throws:
Throwable

readStructModel

public StructModel readStructModel(String file)
                            throws Throwable
Throws:
Throwable

printStructHelp

public void printStructHelp()

parseStructParameters

public void parseStructParameters()
                           throws Throwable
Throws:
Throwable

test

public void test(String[] argv)
          throws Throwable
Throws:
Throwable