learning FactorGraphModel