Ensure that the performant underlying implementation is used.

This took testing an RBM on the MNIST testing set from ~26 hours to
~268 seconds.