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

stereomatchingkiss notifications at github.com
Sat Dec 12 03:08:39 EST 2015


When implementing sparse autoencoder by FNN, I find out there are some copy could be eliminated, I think the first one should be deal with is the Forward function.

    template<size_t I = 0, typename DataType, typename... Tp>
    void Forward(const DataType& input, std::tuple<Tp...>& t)
    {
      std::get<I>(t).InputParameter() = input;    
      //.......
    }

The input data could be quite big(several MB or GB), it would be better if we could eliminate this copy. If there are another api like

    std::get<I>(t).InputParameter(input);

Then it is possible to use a pointer point to the input if we know the input would not modified, but this would 
1 : add one more api to the layers
2 : part of the layers may need another template parameter to determine the input parameter is const or not(I am not sure about this part).

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


More information about the mlpack-git mailing list