GithubHelp home page GithubHelp logo

adaptivescalar_test.py about nupic HOT 6 CLOSED

chhenning avatar chhenning commented on June 24, 2024
adaptivescalar_test.py

from nupic.

Comments (6)

chhenning avatar chhenning commented on June 24, 2024

same with category_test.py

from nupic.

chhenning avatar chhenning commented on June 24, 2024
..E.s.E
======================================================================
ERROR: testNonPeriodicEncoderMinMaxNotSpec (__main__.AdaptiveScalarTest)
Non-periodic encoder, min and max not specified
----------------------------------------------------------------------
Traceback (most recent call last):
  File "adaptivescalar_test.py", line 150, in testNonPeriodicEncoderMinMaxNotSpec
    _verify(1, [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0])
  File "adaptivescalar_test.py", line 143, in _verify
    abs(l.getBucketInfo(l.getBucketIndices(v))[0].value - expV),
  File "D:\nupic\src\python\python3\nupic\encoders\adaptive_scalar.py", line 186, in getBucketInfo
    return super(AdaptiveScalarEncoder, self).getBucketInfo(buckets)
  File "D:\nupic\src\python\python3\nupic\encoders\scalar.py", line 659, in getBucketInfo
    encoding = self._topDownMappingM.getRow(category)
TypeError: getRow(): incompatible function arguments. The following argument types are supported:
    1. (self: nupic.bindings.math.SM32, arg0: int) -> numpy.ndarray[float32]

Invoked with: <nupic.bindings.math.SM32 object at 0x00000158698C42D0>, 0.0

======================================================================
ERROR: testTopDownDecode (__main__.AdaptiveScalarTest)
Test the input description generation and topDown decoding
----------------------------------------------------------------------
Traceback (most recent call last):
  File "adaptivescalar_test.py", line 96, in testTopDownDecode
    topDown = l.topDownCompute(output)[0]
  File "D:\nupic\src\python\python3\nupic\encoders\adaptive_scalar.py", line 197, in topDownCompute
    return super(AdaptiveScalarEncoder, self).topDownCompute(encoded)
  File "D:\nupic\src\python\python3\nupic\encoders\scalar.py", line 679, in topDownCompute
    category = topDownMappingM.rightVecProd(encoded).argmax()
AttributeError: 'nupic.bindings.math.SM32' object has no attribute 'rightVecProd'

----------------------------------------------------------------------
Ran 7 tests in 0.027s

FAILED (errors=2, skipped=1)

from nupic.

chhenning avatar chhenning commented on June 24, 2024

The original python errors have been resolved by adding int(float value).

from nupic.

chhenning avatar chhenning commented on June 24, 2024
 encoding = self._topDownMappingM.getRow(category)
TypeError: getRow(): incompatible function arguments. The following argument types are supported:
    1. (self: nupic.bindings.math.SM32, arg0: int) -> numpy.ndarray[float32]

encoding = self._topDownMappingM.getRow(category)
to
encoding = self._topDownMappingM.getRow(int(category))

from nupic.

chhenning avatar chhenning commented on June 24, 2024

Previous error is fixed. Now we have:


D:\nupic\src\python\python3\tests\unit\nupic\encoders>python adaptivescalar_test.py
....s.F
======================================================================
FAIL: testTopDownDecode (__main__.AdaptiveScalarTest)
Test the input description generation and topDown decoding
----------------------------------------------------------------------
Traceback (most recent call last):
  File "adaptivescalar_test.py", line 94, in testTopDownDecode
    self.assertLess(abs(rangeMin - v), l.resolution)
AssertionError: 1.0 not less than 1.0

----------------------------------------------------------------------
Ran 7 tests in 0.010s

FAILED (failures=1, skipped=1)

from nupic.

chhenning avatar chhenning commented on June 24, 2024

It was an integer division issue.

from nupic.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.