[mlpack-git] [mlpack/mlpack] parallel sgd (#603)
Stephen Tu
notifications at github.com
Thu Apr 7 13:54:27 EDT 2016
> + arma::mat sumIterate(iterate.n_rows,iterate.n_cols);
> + size_t it;
> + bool halt=false;
> + sumIterate.zeros();
> +
> +
> +
> + #pragma omp parallel shared(sumIterate,halt) private(it)
> + {
> + it=1;
> + while(it!=maxIterations && halt != true)
> + {
> + it++;
> +
> + int th_num=omp_get_thread_num(); //thread number is stored in which the thread is running.
> + arma::mat gradient(iterate.n_rows, iterate.n_cols); //To make gradient private to each thread it is declared here.
Why not allocate this variable outside the while loop so we don't reallocate memory for the local gradient every iteration?
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/603/files/a981f8322e84ec06a349b80d261639a282f4f7c5#r58915727
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160407/dd31dc41/attachment.html>
More information about the mlpack-git
mailing list