add weights to output grounded MRF