code: public static FactorGraph getFgLat(FactorGraph fgLatPred, VarConfig goldConfig) {
          // TODO: instead, have this just look at whether or not the var is in the gold config
          List<Var> predictedVars = VarSet.getVarsOfType(fgLatPred.getVars(), VarType.PREDICTED);
          VarConfig predConfig = goldConfig.getIntersection(predictedVars);
          FactorGraph fgLat = fgLatPred.getClamped(predConfig);
          assert (fgLatPred.getNumFactors() <= fgLat.getNumFactors());
          return fgLat;
      }
docs: Get a copy of the factor graph where the predicted variables are clamped.
  
  @param fgLatPred The original factor graph.
  @param goldConfig The assignment to the predicted variables.
  @return The clamped factor graph.