Skip to content

sdrcategory_test.py #19

@chhenning

Description

@chhenning
input: <UNKNOWN> index: 0 output: [ 0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.
  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.
  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.
  0.  1.  0.  0.  0.  0.  0.  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.
  0.  1.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  0.  1.  0.
  0.  1.  0.  1.  0.  0.  0.  0.  0.  0.]
Overlaps for decoding:
10 <UNKNOWN>
decoded: foo:[<UNKNOWN>]
EsE
======================================================================
ERROR: testAutogrow (__main__.SDRCategoryEncoderTest)
testing auto-grow
----------------------------------------------------------------------
Traceback (most recent call last):
  File "sdrcategory_test.py", line 221, in testAutogrow
    s.encodeIntoArray("catA", encoded)
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 240, in encodeIntoArray
    index = self.getBucketIndices(input)[0]
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 232, in getBucketIndices
    return self.getScalars(input)
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 218, in getScalars
    self._addCategory(input)
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 170, in _addCategory
    newrep = self._newRep()
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 198, in _newRep
    "%d attempts" % (self.ncategories, maxAttempts))
RuntimeError: Error, could not find unique pattern 1 after 1000 attempts

======================================================================
ERROR: testSDRCategoryEncoder (__main__.SDRCategoryEncoderTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "sdrcategory_test.py", line 55, in testSDRCategoryEncoder
    name="foo", verbosity=0, forced=True)
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 96, in __init__
    self._addCategory(category)
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 170, in _addCategory
    newrep = self._newRep()
  File "D:\nupic\src\python\python3\nupic\encoders\sdr_category.py", line 198, in _newRep
    "%d attempts" % (self.ncategories, maxAttempts))
RuntimeError: Error, could not find unique pattern 1 after 1000 attempts

----------------------------------------------------------------------
Ran 3 tests in 0.266s

FAILED (errors=2, skipped=1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions