public class DVParserCostAndGradient extends AbstractCachingDiffFunction
derivative, generator, value
Constructor and Description |
---|
DVParserCostAndGradient(List<Tree> trainingBatch,
IdentityHashMap<Tree,List<Tree>> topParses,
DVModel dvModel,
Options op) |
Modifier and Type | Method and Description |
---|---|
void |
backpropDerivative(Tree tree,
List<String> words,
IdentityHashMap<Tree,org.ejml.simple.SimpleMatrix> nodeVectors,
TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryW_dfs,
Map<String,org.ejml.simple.SimpleMatrix> unaryW_dfs,
TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryScoreDerivatives,
Map<String,org.ejml.simple.SimpleMatrix> unaryScoreDerivatives,
Map<String,org.ejml.simple.SimpleMatrix> wordVectorDerivatives) |
void |
backpropDerivative(Tree tree,
List<String> words,
IdentityHashMap<Tree,org.ejml.simple.SimpleMatrix> nodeVectors,
TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryW_dfs,
Map<String,org.ejml.simple.SimpleMatrix> unaryW_dfs,
TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryScoreDerivatives,
Map<String,org.ejml.simple.SimpleMatrix> unaryScoreDerivatives,
Map<String,org.ejml.simple.SimpleMatrix> wordVectorDerivatives,
org.ejml.simple.SimpleMatrix deltaUp) |
void |
calculate(double[] theta)
Calculate the value at x and the derivative
and save them in the respective fields.
|
int |
domainDimension()
Returns the number of dimensions in the function's domain
|
List<DeepTree> |
getAllHighestScoringTreesTest(List<Tree> trees) |
DeepTree |
getHighestScoringTree(Tree tree,
double lambda) |
double |
getMargin(Tree goldTree,
Tree bestHypothesis) |
static void |
outputSpans(Tree tree) |
double |
score(Tree tree,
IdentityHashMap<Tree,org.ejml.simple.SimpleMatrix> nodeVectors) |
clearCache, copy, derivativeAt, ensure, getDerivative, gradientCheck, gradientCheck, initial, lastValue, randomInitial, valueAt
public static void outputSpans(Tree tree)
public double score(Tree tree, IdentityHashMap<Tree,org.ejml.simple.SimpleMatrix> nodeVectors)
public int domainDimension()
Function
public void calculate(double[] theta)
AbstractCachingDiffFunction
calculate
in class AbstractCachingDiffFunction
theta
- The point at which to calculate the functionpublic void backpropDerivative(Tree tree, List<String> words, IdentityHashMap<Tree,org.ejml.simple.SimpleMatrix> nodeVectors, TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryW_dfs, Map<String,org.ejml.simple.SimpleMatrix> unaryW_dfs, TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryScoreDerivatives, Map<String,org.ejml.simple.SimpleMatrix> unaryScoreDerivatives, Map<String,org.ejml.simple.SimpleMatrix> wordVectorDerivatives)
public void backpropDerivative(Tree tree, List<String> words, IdentityHashMap<Tree,org.ejml.simple.SimpleMatrix> nodeVectors, TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryW_dfs, Map<String,org.ejml.simple.SimpleMatrix> unaryW_dfs, TwoDimensionalMap<String,String,org.ejml.simple.SimpleMatrix> binaryScoreDerivatives, Map<String,org.ejml.simple.SimpleMatrix> unaryScoreDerivatives, Map<String,org.ejml.simple.SimpleMatrix> wordVectorDerivatives, org.ejml.simple.SimpleMatrix deltaUp)