[mlpack-git] [mlpack/mlpack] parallel sgd (#603)
ranjan
notifications at github.com
Thu Apr 7 11:47:30 EDT 2016
> + {
> + 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.
> + int selectedFunction;
> +
> + selectedFunction=std::rand()%numFunctions;
> + function.Gradient(tIterate[th_num],selectedFunction, gradient);
> + tIterate[th_num] -= stepSize * gradient;
> +
> +
> + //checking whether or not it will go for tollerence checking
T is added to run each thread independently T iteration to increase speedup.
Here I have Taken T as constant(1000).
T can be a function of maxiteration, number of thread, current value of 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#r58895238
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160407/ecd7d9b3/attachment.html>
More information about the mlpack-git
mailing list