private int initSparseWeights (InstanceList training) { // checkCliqueSizeConsistent (training); //debug int total = 0; // Build this bitsets that tell us what weights occur in the data int size = cliqueSizeFromInstance (training); BitSet[] weightsPresent = new BitSet [size]; for (int i = 0; i < size; i++) { weightsPresent [i] = new BitSet (); } assignmentsPresent = new BitSet (size); collectWeightsPresent (training, weightsPresent); if (weights != null) { addInCurrentWeights (weightsPresent); } // We can allocate default Weights now total += allocateDefaultWeights (size); // Use those to allocate the SparseVectors SparseVector[] newWeights = new SparseVector [size]; total += allocateNewWeights (weightsPresent, newWeights); logger.info ("ACRF template "+this+" total num weights = "+total); this.weights = newWeights; return total; }
private int initSparseWeights (InstanceList training) { // checkCliqueSizeConsistent (training); //debug int total = 0; // Build this bitsets that tell us what weights occur in the data int size = cliqueSizeFromInstance (training); BitSet[] weightsPresent = new BitSet [size]; for (int i = 0; i < size; i++) { weightsPresent [i] = new BitSet (); } assignmentsPresent = new BitSet (size); collectWeightsPresent (training, weightsPresent); if (weights != null) { addInCurrentWeights (weightsPresent); } // We can allocate default Weights now total += allocateDefaultWeights (size); // Use those to allocate the SparseVectors SparseVector[] newWeights = new SparseVector [size]; total += allocateNewWeights (weightsPresent, newWeights); logger.info ("ACRF template "+this+" total num weights = "+total); this.weights = newWeights; return total; }
private int initSparseWeights (InstanceList training) { // checkCliqueSizeConsistent (training); //debug int total = 0; // Build this bitsets that tell us what weights occur in the data int size = cliqueSizeFromInstance (training); BitSet[] weightsPresent = new BitSet [size]; for (int i = 0; i < size; i++) { weightsPresent [i] = new BitSet (); } assignmentsPresent = new BitSet (size); collectWeightsPresent (training, weightsPresent); if (weights != null) { addInCurrentWeights (weightsPresent); } // We can allocate default Weights now total += allocateDefaultWeights (size); // Use those to allocate the SparseVectors SparseVector[] newWeights = new SparseVector [size]; total += allocateNewWeights (weightsPresent, newWeights); logger.info ("ACRF template "+this+" total num weights = "+total); this.weights = newWeights; return total; }
private int initDenseWeights (InstanceList training) { int numf = training.getDataAlphabet ().size (); int total = 0; // handle default weights int size = cliqueSizeFromInstance (training); total += allocateDefaultWeights (size); // and regular weights SparseVector[] newWeights = new SparseVector [size]; for (int i = 0; i < size; i++) { newWeights [i] = new SparseVector (new double[numf], false); if (weights != null) newWeights [i].plusEqualsSparse (weights [i]); total += numf; logger.info ("ACRF template "+this+" weights ["+i+"] num features "+numf); } logger.info ("ACRF template "+this+" total num weights = "+total); weights = newWeights; return total; }
private int initDenseWeights (InstanceList training) { int numf = training.getDataAlphabet ().size (); int total = 0; // handle default weights int size = cliqueSizeFromInstance (training); total += allocateDefaultWeights (size); // and regular weights SparseVector[] newWeights = new SparseVector [size]; for (int i = 0; i < size; i++) { newWeights [i] = new SparseVector (new double[numf], false); if (weights != null) newWeights [i].plusEqualsSparse (weights [i]); total += numf; logger.info ("ACRF template "+this+" weights ["+i+"] num features "+numf); } logger.info ("ACRF template "+this+" total num weights = "+total); weights = newWeights; return total; }
private int initDenseWeights (InstanceList training) { int numf = training.getDataAlphabet ().size (); int total = 0; // handle default weights int size = cliqueSizeFromInstance (training); total += allocateDefaultWeights (size); // and regular weights SparseVector[] newWeights = new SparseVector [size]; for (int i = 0; i < size; i++) { newWeights [i] = new SparseVector (new double[numf], false); if (weights != null) newWeights [i].plusEqualsSparse (weights [i]); total += numf; logger.info ("ACRF template "+this+" weights ["+i+"] num features "+numf); } logger.info ("ACRF template "+this+" total num weights = "+total); weights = newWeights; return total; }