[mlpack-git] master: fix bug in binarize (e3fc85e)

gitdub at mlpack.org gitdub at mlpack.org
Wed Jun 15 00:09:39 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/a0b31abe5ff69117645c664dbeac1476dd5e48f7...2da9c5bac14a00145c757b8139c245913b86e034

>---------------------------------------------------------------

commit e3fc85edb5eb9aac98052238ff2904ea9bd9b842
Author: Keon Kim <kwk236 at gmail.com>
Date:   Wed Jun 15 13:09:34 2016 +0900

    fix bug in binarize


>---------------------------------------------------------------

e3fc85edb5eb9aac98052238ff2904ea9bd9b842
 src/mlpack/core/data/binarize.hpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mlpack/core/data/binarize.hpp b/src/mlpack/core/data/binarize.hpp
index 38d22b6..7a47ffd 100644
--- a/src/mlpack/core/data/binarize.hpp
+++ b/src/mlpack/core/data/binarize.hpp
@@ -47,10 +47,10 @@ void Binarize(const arma::Mat<T>& input,
   #pragma omp parallel for
   for (size_t i = 0; i < totalElems; ++i)
   {
-    if (inPtr[i] < threshold)
-      outPtr[i] = 0;
-    else
+    if (inPtr[i] > threshold)
       outPtr[i] = 1;
+    else
+      outPtr[i] = 0;
   }
 }
 




More information about the mlpack-git mailing list