FIX numerical stability issue in BernoulliRBM

Fixes #2785 by replacing log1p(exp(x)) with logaddexp(0, x).