We have access to the ensemble Z ME 0 a set of conformations {x i : i = 1, ..., N } along with their weights {w i : i = 1, ..., N }. We aim to identify force field parameters θ such that the canonical ensemble of the system p(x; θ) reproduces the ensemble Z ME 0 . Similar problems also arise in learning CG force fields using the bottom-up approach, where CG force fields are learned to reproduce the distribution of a set of conformations generated using all-atom simulations. Therefore we use the potential contrasting method, initially developed for learning CG force fields from all-atom simulations, to optimize force field parameters θ to reproduce the reweighted ensemble Z ME 0 . The potential contrasting method is a generalization of the noise contrastive estimation method and it works by contrasting the potential energy function U (x; θ) against a noise potential energy function. With the theory of potential contrasting presented in previous works, we focus herein on the practical application of this technique to optimize the force field parameters θ to reproduce the reweighted ensemble Z ME 0 .