scikit-learn/scikit-learn — pull request #2882 by larsmans (2014-02-22 13:37:19+00:00)
Title: [MRG] speed up RBM training with scipy.special.expit

SciPy 0.10 already has an implementation of the logistic function called `scipy.special.expit`. Moved our `logistic_sigmoid` to `fixes.expit`, keeping its log-of-logistic functionality as `log_logistic` (should that be `log_expit`? I don't like the name `expit` at all.)

Using this makes RBM training 12% faster, as measured by observing the time per iteration as reported by the `plot_rbm_logistic_classification.py` example, disregarding the first iteration as an outlier (it's consistently faster than the rest, not sure why). The speedup is in the `expit` function, not the inplace operations; those are there to make benchmarking easier, but they certainly won't hurt.