CRFLogConditionalObjectiveFunction(int[][][][] data, int[][] labels, int window, Index<String> classIndex, List<Index<CRFLabel>> labelIndices, int[] map, String priorType, String backgroundSymbol, double sigma, double[][][][] featureVal, int multiThreadGrad, boolean calcEmpirical) { this.window = window; this.classIndex = classIndex; this.numClasses = classIndex.size(); this.labelIndices = labelIndices; this.map = map; this.data = data; this.featureVal = featureVal; this.labels = labels; this.prior = getPriorType(priorType); this.backgroundSymbol = backgroundSymbol; this.sigma = sigma; this.multiThreadGrad = multiThreadGrad; // takes docIndex, returns Triple<prob, E, dropoutGrad> Ehat = empty2D(); E = empty2D(); weights = empty2D(); if (calcEmpirical) empiricalCounts(Ehat); int myDomainDimension = 0; for (int dim : map) { myDomainDimension += labelIndices.get(dim).size(); } domainDimension = myDomainDimension; }
CRFLogConditionalObjectiveFunction(int[][][][] data, int[][] labels, int window, Index<String> classIndex, List<Index<CRFLabel>> labelIndices, int[] map, String priorType, String backgroundSymbol, double sigma, double[][][][] featureVal, int multiThreadGrad, boolean calcEmpirical) { this.window = window; this.classIndex = classIndex; this.numClasses = classIndex.size(); this.labelIndices = labelIndices; this.map = map; this.data = data; this.featureVal = featureVal; this.labels = labels; this.prior = getPriorType(priorType); this.backgroundSymbol = backgroundSymbol; this.sigma = sigma; this.multiThreadGrad = multiThreadGrad; // takes docIndex, returns Triple<prob, E, dropoutGrad> Ehat = empty2D(); E = empty2D(); weights = empty2D(); if (calcEmpirical) empiricalCounts(Ehat); int myDomainDimension = 0; for (int dim : map) { myDomainDimension += labelIndices.get(dim).size(); } domainDimension = myDomainDimension; }
CRFLogConditionalObjectiveFunction(int[][][][] data, int[][] labels, int window, Index<String> classIndex, List<Index<CRFLabel>> labelIndices, int[] map, String priorType, String backgroundSymbol, double sigma, double[][][][] featureVal, int multiThreadGrad, boolean calcEmpirical) { this.window = window; this.classIndex = classIndex; this.numClasses = classIndex.size(); this.labelIndices = labelIndices; this.map = map; this.data = data; this.featureVal = featureVal; this.labels = labels; this.prior = getPriorType(priorType); this.backgroundSymbol = backgroundSymbol; this.sigma = sigma; this.multiThreadGrad = multiThreadGrad; // takes docIndex, returns Triple<prob, E, dropoutGrad> Ehat = empty2D(); E = empty2D(); weights = empty2D(); if (calcEmpirical) empiricalCounts(Ehat); int myDomainDimension = 0; for (int dim : map) { myDomainDimension += labelIndices.get(dim).size(); } domainDimension = myDomainDimension; }
private void empiricalCounts(int[][][][] data, int[][] labels) { Ehat = empty2D();
double[][] E = empty2D();
double[][] E = empty2D();