[mlpack-git] [mlpack/mlpack] Added the discretize function. Design changes as discussed. (#703)

Marcus Edel notifications at github.com
Sun Aug 14 11:53:37 EDT 2016


> +      dis = arma::sqrt(dis);      
> +
> +      // find positive and negative edge locations using mask.
> +      arma::uvec posLoc = arma::find( (dis < gRad) % mask );
> +      arma::uvec negLoc = arma::find( (dis >= gRad) % mask );
> +
> +      // we take a random permutation of posLoc and negLoc.
> +      posLoc = arma::shuffle(posLoc);
> +      negLoc = arma::shuffle(negLoc);
> +
> +      size_t lenLoc = std::min((int) negLoc.n_elem, std::min((int) nPatchesPerGt,
> +                              (int) posLoc.n_elem));
> +      arma::umat loc(lenLoc * 2, 2);
> +
> +      for(size_t i = 0; i < lenLoc; ++i)
> +        loc.row(i) = arma::ind2sub(arma::size(dis.n_rows, dis.n_cols), posLoc(i) ).t();

Do you think, we could store the location in the columns, in this case we don't have to transpose the locations vector.

-- 
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/703/files/72eb1ef22c7db1ea33af3de1cd043cdb277ec562#r74704185
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160814/dd4ee18e/attachment-0001.html>


More information about the mlpack-git mailing list