/** * Unfreezes a set of weights. * Frozen weights are used for labeling sequences (as in <tt>transduce</tt>), * but are not be modified by the <tt>train</tt> methods. * @param weightsName Name of weight set to unfreeze. */ public void unfreezeWeights (String weightsName) { int widx = getWeightsIndex (weightsName); parameters.weightsFrozen[widx] = false; }
/** * Unfreezes a set of weights. * Frozen weights are used for labeling sequences (as in <tt>transduce</tt>), * but are not be modified by the <tt>train</tt> methods. * @param weightsName Name of weight set to unfreeze. */ public void unfreezeWeights (String weightsName) { int widx = getWeightsIndex (weightsName); parameters.weightsFrozen[widx] = false; }
public SparseVector getWeights (String weightName) { return parameters.weights[getWeightsIndex (weightName)]; }
public SparseVector getWeights (String weightName) { return parameters.weights[getWeightsIndex (weightName)]; }
/** * Unfreezes a set of weights. * Frozen weights are used for labeling sequences (as in <tt>transduce</tt>), * but are not be modified by the <tt>train</tt> methods. * @param weightsName Name of weight set to unfreeze. */ public void unfreezeWeights (String weightsName) { int widx = getWeightsIndex (weightsName); parameters.weightsFrozen[widx] = false; }
public SparseVector getWeights (String weightName) { return parameters.weights[getWeightsIndex (weightName)]; }
public void addWeight (int didx, String weightName) { int widx = crf.getWeightsIndex (weightName); weightsIndices[didx] = ArrayUtils.append (weightsIndices[didx], widx); }
public void setWeights (String weightName, SparseVector transitionWeights) { setWeights (getWeightsIndex (weightName), transitionWeights); }
public void setWeights (String weightName, SparseVector transitionWeights) { setWeights (getWeightsIndex (weightName), transitionWeights); }
public void addWeight (int didx, String weightName) { int widx = crf.getWeightsIndex (weightName); weightsIndices[didx] = ArrayUtils.append (weightsIndices[didx], widx); }
/** * Freezes a set of weights to their current values. * Frozen weights are used for labeling sequences (as in <tt>transduce</tt>), * but are not be modified by the <tt>train</tt> methods. * @param weightsName Name of weight set to freeze. */ public void freezeWeights (String weightsName) { int widx = getWeightsIndex (weightsName); freezeWeights (widx); }
/** * Freezes a set of weights to their current values. * Frozen weights are used for labeling sequences (as in <tt>transduce</tt>), * but are not be modified by the <tt>train</tt> methods. * @param weightsName Name of weight set to freeze. */ public void freezeWeights (String weightsName) { int widx = getWeightsIndex (weightsName); freezeWeights (widx); }
/** * Freezes a set of weights to their current values. * Frozen weights are used for labeling sequences (as in <tt>transduce</tt>), * but are not be modified by the <tt>train</tt> methods. * @param weightsName Name of weight set to freeze. */ public void freezeWeights (String weightsName) { int widx = getWeightsIndex (weightsName); freezeWeights (widx); }
public void setWeights (String weightName, SparseVector transitionWeights) { setWeights (getWeightsIndex (weightName), transitionWeights); }
public void addWeight (int didx, String weightName) { int widx = crf.getWeightsIndex (weightName); weightsIndices[didx] = ArrayUtils.append (weightsIndices[didx], widx); }
this.weightsIndices[i] = new int[weightNames[i].length]; for (int j = 0; j < weightNames[i].length; j++) this.weightsIndices[i][j] = crf.getWeightsIndex (weightNames[i][j]);
public void addFullyConnectedStatesForThreeQuarterLabels (InstanceList trainingSet) { int numLabels = outputAlphabet.size(); for (int i = 0; i < numLabels; i++) { String[] destinationNames = new String[numLabels]; String[][] weightNames = new String[numLabels][]; for (int j = 0; j < numLabels; j++) { String labelName = (String)outputAlphabet.lookupObject(j); destinationNames[j] = labelName; weightNames[j] = new String[2]; // The "half-labels" will include all observational tests weightNames[j][0] = labelName; // The "transition" weights will include only the default feature String wn = (String)outputAlphabet.lookupObject(i) + "->" + (String)outputAlphabet.lookupObject(j); weightNames[j][1] = wn; int wi = getWeightsIndex (wn); // A new empty FeatureSelection won't allow any features here, so we only // get the default feature for transitions featureSelections[wi] = new FeatureSelection(trainingSet.getDataAlphabet()); } addState ((String)outputAlphabet.lookupObject(i), 0.0, 0.0, destinationNames, destinationNames, weightNames); } }
public void addFullyConnectedStatesForThreeQuarterLabels (InstanceList trainingSet) { int numLabels = outputAlphabet.size(); for (int i = 0; i < numLabels; i++) { String[] destinationNames = new String[numLabels]; String[][] weightNames = new String[numLabels][]; for (int j = 0; j < numLabels; j++) { String labelName = (String)outputAlphabet.lookupObject(j); destinationNames[j] = labelName; weightNames[j] = new String[2]; // The "half-labels" will include all observational tests weightNames[j][0] = labelName; // The "transition" weights will include only the default feature String wn = (String)outputAlphabet.lookupObject(i) + "->" + (String)outputAlphabet.lookupObject(j); weightNames[j][1] = wn; int wi = getWeightsIndex (wn); // A new empty FeatureSelection won't allow any features here, so we only // get the default feature for transitions featureSelections[wi] = new FeatureSelection(trainingSet.getDataAlphabet()); } addState ((String)outputAlphabet.lookupObject(i), 0.0, 0.0, destinationNames, destinationNames, weightNames); } }
public void addFullyConnectedStatesForThreeQuarterLabels (InstanceList trainingSet) { int numLabels = outputAlphabet.size(); for (int i = 0; i < numLabels; i++) { String[] destinationNames = new String[numLabels]; String[][] weightNames = new String[numLabels][]; for (int j = 0; j < numLabels; j++) { String labelName = (String)outputAlphabet.lookupObject(j); destinationNames[j] = labelName; weightNames[j] = new String[2]; // The "half-labels" will include all observational tests weightNames[j][0] = labelName; // The "transition" weights will include only the default feature String wn = (String)outputAlphabet.lookupObject(i) + "->" + (String)outputAlphabet.lookupObject(j); weightNames[j][1] = wn; int wi = getWeightsIndex (wn); // A new empty FeatureSelection won't allow any features here, so we only // get the default feature for transitions featureSelections[wi] = new FeatureSelection(trainingSet.getDataAlphabet()); } addState ((String)outputAlphabet.lookupObject(i), 0.0, 0.0, destinationNames, destinationNames, weightNames); } }
int wi = getWeightsIndex (wn);