コード例 #1
0
ファイル: Sparsifier.java プロジェクト: mmathioudakis/spine
 public void computeAuxiliary(
     ObservationsReader observations, CandidateSelectionPolicy candidateSelectionPolicy) {
   if (this.auxiliary != null) {
     throw new IllegalStateException("Auxiliary was already set");
   }
   this.auxiliary =
       new ICEstimateAuxiliary(originalModel.getSn(), observations, candidateSelectionPolicy);
 }
コード例 #2
0
ファイル: Sparsifier.java プロジェクト: mmathioudakis/spine
 /**
  * Computes and stores the partial fraction of covered propagations.
  *
  * <p>Works only if {@link #computeFractionOfPropagations} is true, otherwise does nothing.
  *
  * @param observations the observations
  * @param newProbs the probabilities of the current model
  * @param i a number indicating the number of edges so far
  */
 protected void computeAndStorePartialFractionOfPropagations(
     ObservationsReader observations, SparseDoubleMatrix2D newProbs, int i) {
   if (computeFractionOfPropagations) {
     ICModel tempModel = new ICModel(originalModel.getSn(), newProbs);
     double sparsifiedFraction = tempModel.getTotalFraction(observations);
     storePartialResult(Measure.FRACTION_OF_PROPAGATIONS, i, sparsifiedFraction);
   }
 }
コード例 #3
0
ファイル: Sparsifier.java プロジェクト: mmathioudakis/spine
 protected double computeAndStorePartialLogLikelihood(int k, SparseDoubleMatrix2D newProbs) {
   ICModel model = new ICModel(originalModel.getSn(), newProbs);
   double logLikelihood = model.getLogLikelihoodIgnoringParentInformation(auxiliary);
   storePartialResult(Measure.LOG_L, k, logLikelihood);
   return logLikelihood;
 }