contrastive divergence fixes