Monte Carlo sampling for stochastic weight functions.

Monte Carlo sampling for stochastic weight functions.