implemented comparison of free-energy on hold-out set.