# [mlpack-git] [mlpack] improve speed of SparseAutoencoder and make it more flexible (#451)

Tue Sep 29 09:23:20 EDT 2015

> + * f^{-1}(y) &=& ln(\frac{y}{1-y})
> + * @f}
> + */
> +class LazyLogisticFunction
> +{
> +  public:
> +  /**
> +   * Computes the logistic function without checking overflow or underflow
> +   *
> +   * @param x Input data.
> +   * @param y The resulting output activation.
> +   */
> +  template<typename InputVecType, typename OutputVecType>
> +  static void fn(const InputVecType& x, OutputVecType& y)
> +  {
> +    y = (1.0 / (1 + arma::exp(-x)));

Originally my intention for the overflow checks in the LogisticFunction class was to avoid strange issues during the training process. But I'm intended to remove the checks in the LogisticFunction class, if you agree we can remove the LazyLogisticFunction class and just use the LogisticFunction class.

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/451/files#r40669794
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150929/d9c41306/attachment.html>