public ProbabilityFunction<ObservationType> call() { final int N = this.gammas.size(); for( int n = 0; n < N; n++ ) { this.weightedValues.get(n).setWeight( this.gammas.get(n).getElement( this.index ) ); } return this.distributionLearner.learn(this.weightedValues).getProbabilityFunction(); }
public ProbabilityFunction<ObservationType> call() { final int N = this.gammas.size(); for( int n = 0; n < N; n++ ) { this.weightedValues.get(n).setWeight( this.gammas.get(n).getElement( this.index ) ); } return this.distributionLearner.learn(this.weightedValues).getProbabilityFunction(); }
public ProbabilityFunction<ObservationType> call() { final int N = this.gammas.size(); for( int n = 0; n < N; n++ ) { this.weightedValues.get(n).setWeight( this.gammas.get(n).getElement( this.index ) ); } return this.distributionLearner.learn(this.weightedValues).getProbabilityFunction(); }
/** * Scales all of the weights in the given kernel binary categorizer by * the given value. * * @param target * The kernel binary categorizer to update the weights on. * @param scale * The scale to apply to all the weights. */ public static void scaleEquals( final DefaultKernelBinaryCategorizer<?> target, final double scale) { for (DefaultWeightedValue<?> example : target.getExamples()) { final double oldWeight = example.getWeight(); final double newWeight = scale * oldWeight; example.setWeight(newWeight); } } }
/** * Scales all of the weights in the given kernel binary categorizer by * the given value. * * @param target * The kernel binary categorizer to update the weights on. * @param scale * The scale to apply to all the weights. */ public static void scaleEquals( final DefaultKernelBinaryCategorizer<?> target, final double scale) { for (DefaultWeightedValue<?> example : target.getExamples()) { final double oldWeight = example.getWeight(); final double newWeight = scale * oldWeight; example.setWeight(newWeight); } } }
/** * Scales all of the weights in the given kernel binary categorizer by * the given value. * * @param target * The kernel binary categorizer to update the weights on. * @param scale * The scale to apply to all the weights. */ public static void scaleEquals( final DefaultKernelBinaryCategorizer<?> target, final double scale) { for (DefaultWeightedValue<?> example : target.getExamples()) { final double oldWeight = example.getWeight(); final double newWeight = scale * oldWeight; example.setWeight(newWeight); } } }
/** * Updates the probability function from the concatenated gammas from * all sequences * @param sequenceGammas * Concatenated gammas from all sequences * @return * Maximum Likelihood probability functions */ protected ArrayList<ProbabilityFunction<ObservationType>> updateProbabilityFunctions( ArrayList<Vector> sequenceGammas ) { final int numStates = this.result.getNumStates(); ArrayList<ProbabilityFunction<ObservationType>> fs = new ArrayList<ProbabilityFunction<ObservationType>>( numStates ); for( int i = 0; i < numStates; i++ ) { int index = 0; for( int n = 0; n < sequenceGammas.size(); n++ ) { final double g = sequenceGammas.get(n).getElement(i); this.weightedData.get(index).setWeight(g); index++; } ProbabilityFunction<ObservationType> f = this.distributionLearner.learn( this.weightedData ).getProbabilityFunction(); fs.add( f ); } return fs; }
/** * Updates the probability function from the concatenated gammas from * all sequences * @param sequenceGammas * Concatenated gammas from all sequences * @return * Maximum Likelihood probability functions */ protected ArrayList<ProbabilityFunction<ObservationType>> updateProbabilityFunctions( ArrayList<Vector> sequenceGammas ) { final int numStates = this.result.getNumStates(); ArrayList<ProbabilityFunction<ObservationType>> fs = new ArrayList<ProbabilityFunction<ObservationType>>( numStates ); for( int i = 0; i < numStates; i++ ) { int index = 0; for( int n = 0; n < sequenceGammas.size(); n++ ) { final double g = sequenceGammas.get(n).getElement(i); this.weightedData.get(index).setWeight(g); index++; } ProbabilityFunction<ObservationType> f = this.distributionLearner.learn( this.weightedData ).getProbabilityFunction(); fs.add( f ); } return fs; }
/** * Updates the probability function from the concatenated gammas from * all sequences * @param sequenceGammas * Concatenated gammas from all sequences * @return * Maximum Likelihood probability functions */ protected ArrayList<ProbabilityFunction<ObservationType>> updateProbabilityFunctions( ArrayList<Vector> sequenceGammas ) { final int numStates = this.result.getNumStates(); ArrayList<ProbabilityFunction<ObservationType>> fs = new ArrayList<ProbabilityFunction<ObservationType>>( numStates ); for( int i = 0; i < numStates; i++ ) { int index = 0; for( int n = 0; n < sequenceGammas.size(); n++ ) { final double g = sequenceGammas.get(n).getElement(i); this.weightedData.get(index).setWeight(g); index++; } ProbabilityFunction<ObservationType> f = this.distributionLearner.learn( this.weightedData ).getProbabilityFunction(); fs.add( f ); } return fs; }
this.weightedData.get(n).setWeight(this.assignments.get(n)[k]);
this.weightedData.get(n).setWeight(this.assignments.get(n)[k]);
final double logLikelihood = wv.getValue(); final double weight = 1.0/Math.exp(logLikelihood - maxLogLikelihood); wv.setWeight(weight);
final double logLikelihood = wv.getValue(); final double weight = 1.0/Math.exp(logLikelihood - maxLogLikelihood); wv.setWeight(weight);
final double logLikelihood = wv.getValue(); final double weight = 1.0/Math.exp(logLikelihood - maxLogLikelihood); wv.setWeight(weight);
final double newWeight = oldWeight + tau * d.getElement(i) * actual; support.setWeight(newWeight);
final double newWeight = oldWeight + tau * d.getElement(i) * actual; support.setWeight(newWeight);
final double newWeight = oldWeight + tau * d.getElement(i) * actual; support.setWeight(newWeight);
final double oldWeight = support.getWeight(); final double newWeight = oldWeight + d.getElement(i) * actual; support.setWeight(newWeight);
final double oldWeight = support.getWeight(); final double newWeight = oldWeight + d.getElement(i) * actual; support.setWeight(newWeight);
final double oldWeight = support.getWeight(); final double newWeight = oldWeight + d.getElement(i) * actual; support.setWeight(newWeight);