Issue #2455: Make RBM work with sparse input when verbose=True.

This fixes Issue #2455:

the BernoulliRBM class was unable to handle sparse inputs when `verbose=True` was set.