code: public Tensor forward() {
          VarTensor[] varBeliefs = inf.getOutput().varBeliefs;
          double expectedRecall = s.zero();
          for (Var var : vc.getVars()) {
              if (var.getType() == VarType.PREDICTED) {
                  VarTensor marg = varBeliefs[var.getId()];
                  expectedRecall = s.minus(expectedRecall, marg.getValue(vc.getState(var)));
              }
          }
          y = Tensor.getScalarTensor(s, expectedRecall);
          return y;
      }
docs: Forward pass: y = - \sum_{x_i \in x*} b(x_i), where x* is the gold variable assignment.