numenta / nupic.core-legacy

Implementation of core NuPIC algorithms in C++ (under construction)
http://numenta.org
GNU Affero General Public License v3.0
272 stars 277 forks source link

Uniqueness & Indexing Errors in SparseMatrix.hpp #817

Open cogmission opened 8 years ago

cogmission commented 8 years ago

The following 3 assertions failed when running nupic/tests/unit/nupic/algorithms/knn_classifier_test

I'm not sure what individual tests produced each of the following outputs; however I know that more than one test contributed to the output.

EDITED: I decided to figure out which test methods caused the 3 errors.

  1. testOverlapDistanceMethodBadSparsity()
  2. testOverlapDistanceMethodStandardUnsorted()
  3. testOverlapDistanceMethodStandardUnsorted()

Upon second glance, it looks like this output is caused by the test itself (i.e. the test purposely produces these error conditions). If so, please excuse - but there should be a way to suppress this error output?

pydev debugger: starting (pid: 1865) Finding files... done. Importing test modules ... done.

ERR:  ASSERTION FAILED: "0 <= index && index < m" SparseMatrix addRow: Invalid index: 23 - Should be >= 0 and < 20 [/Users/cogmission/git/nupic.core/src/nupic/math/SparseMatrix.hpp line 343]

ERR:  ASSERTION FAILED: "prev < index" SparseMatrix addRow: Indices need to be in strictly increasing order without duplicates, found: 29 and 3 /Users/cogmission/git/nupic.core/src/nupic/math/SparseMatrix.hpp line 352

ERR:  ASSERTION FAILED: "prev < index" SparseMatrix addRow: Indices need to be in strictly increasing order without duplicates, found: 20 and 12 /Users/cogmission/git/nupic.core/src/nupic/math/SparseMatrix.hpp line 352
----------------------------------------------------------------------
Ran 10 tests in 0.032s

OK (skipped=1)
rhyolight commented 8 years ago

Sounds like this might be an issue with how the tests are written? Am I reading that right?

cogmission commented 8 years ago

Yes. At first I thought the test was failing, but then I realized that the errors were on purpose to test bounds and limits. However, the test shouldn't output these errors because it looks like the test is failing...

Because this is a test that spans interfaces between two languages - I take that back, this should definitely not be outputting these errors! (IMO).