Factor graph model