code: public static Module<Factors> getFactorsModule(FactorGraph fg, Algebra s) {
          ForwardOnlyFactorsModule fm = new ForwardOnlyFactorsModule(null, fg, s);
          fm.forward();
          return fm;
      }
docs: Constructs a factors module and runs the forward computation.