edu.stanford.nlp.classify
Class AdaptedGaussianPriorObjectiveFunction<L,F>
java.lang.Object
edu.stanford.nlp.optimization.AbstractCachingDiffFunction
edu.stanford.nlp.optimization.AbstractStochasticCachingDiffFunction
edu.stanford.nlp.optimization.AbstractStochasticCachingDiffUpdateFunction
edu.stanford.nlp.classify.LogConditionalObjectiveFunction<L,F>
edu.stanford.nlp.classify.AdaptedGaussianPriorObjectiveFunction<L,F>
- Type Parameters:
L
- The type of the labels in the Dataset (one can be passed in to the constructor)F
- The type of the features in the Dataset
- All Implemented Interfaces:
- DiffFunction, Function, HasInitial
public class AdaptedGaussianPriorObjectiveFunction<L,F>
- extends LogConditionalObjectiveFunction<L,F>
Adapt the mean of the Gaussian Prior by shifting the mean to the previously trained weights
- Author:
- Pi-Chuan Chang, Sarah Spikes (sdspikes@cs.stanford.edu) (Templatization)
Fields inherited from class edu.stanford.nlp.classify.LogConditionalObjectiveFunction |
data, dataIterable, dataweights, derivativeAD, derivativeNumerator, featureIndex, labelIndex, labels, numClasses, numFeatures, prior, priorDerivative, probs, sums, useIterable, useSummedConditionalLikelihood, values, xAD |
Fields inherited from class edu.stanford.nlp.optimization.AbstractStochasticCachingDiffFunction |
allIndices, curElement, finiteDifferenceStepSize, gradPerturbed, hasNewVals, HdotV, lastBatch, lastBatchSize, lastElement, lastVBatch, lastXBatch, method, randGenerator, recalculatePrevBatch, returnPreviousValues, sampleMethod, scaleUp, thisBatch, xPerturbed |
Method Summary |
protected void |
calculate(double[] x)
Calculate the conditional likelihood. |
protected void |
rvfcalculate(double[] x)
Calculate conditional likelihood for datasets with real-valued features. |
double[] |
to1D(double[][] x2)
|
Methods inherited from class edu.stanford.nlp.classify.LogConditionalObjectiveFunction |
calculateStochastic, calculateStochasticAlgorithmicDifferentiation, calculateStochasticFiniteDifference, calculateStochasticGradientOnly, calculateStochasticUpdate, dataDimension, domainDimension, indexOf, setPrior, setUseSumCondObjFun, to2D, valueAt |
Methods inherited from class edu.stanford.nlp.optimization.AbstractStochasticCachingDiffFunction |
clearCache, decrementBatch, derivativeAt, derivativeAt, getBatch, HdotVAt, HdotVAt, HdotVAt, incrementBatch, incrementRandom, initial, lastDerivative, lastValue, scaleUp, setValue, valueAt, valueAt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AdaptedGaussianPriorObjectiveFunction
public AdaptedGaussianPriorObjectiveFunction(GeneralDataset<L,F> dataset,
LogPrior prior,
double[][] weights)
calculate
protected void calculate(double[] x)
- Calculate the conditional likelihood.
- Overrides:
calculate
in class LogConditionalObjectiveFunction<L,F>
rvfcalculate
protected void rvfcalculate(double[] x)
- Description copied from class:
LogConditionalObjectiveFunction
- Calculate conditional likelihood for datasets with real-valued features.
Currently this can calculate CL only (no support for SCL).
TODO: sum-conditional obj. fun. with RVFs.
- Overrides:
rvfcalculate
in class LogConditionalObjectiveFunction<L,F>
to1D
public double[] to1D(double[][] x2)
Stanford NLP Group