Пример #1
0
 @Override
 public void log(long iteration, int exampleNum, Assignment example, FactorGraph graph) {
   if (showExamples) {
     if (iteration % logInterval == 0) {
       String prob = "";
       if (example.containsAll(graph.getVariables().getVariableNumsArray())) {
         prob = Double.toString(graph.getUnnormalizedLogProbability(example));
       }
       print(
           iteration
               + "."
               + exampleNum
               + " "
               + prob
               + ": example: "
               + graph.assignmentToObject(example));
     }
   }
 }
Пример #2
0
 @Override
 public void log(Assignment example, FactorGraph graph) {
   if (showExamples) {
     print("?.?: example: " + graph.assignmentToObject(example));
   }
 }