예제 #1
0
  def testSensorRegion(self):
    results1 = createAndRunNetwork(RecordSensor, "dataOut")

    results2 = createAndRunNetwork(RecordSensor, "dataOut",
                                   checkpointMidway=True)

    self.compareArrayResults(results1, results2)
    def testSensorRegion(self):
        results1 = createAndRunNetwork(RecordSensor, "dataOut")

        results2 = createAndRunNetwork(RecordSensor,
                                       "dataOut",
                                       checkpointMidway=True)

        self.compareArrayResults(results1, results2)
예제 #3
0
  def testSPRegion(self):
    results1 = createAndRunNetwork(SPRegion, "bottomUpOut")

    results2 = createAndRunNetwork(SPRegion, "bottomUpOut",
                                   checkpointMidway=True)

    self.assertEqual(len(results1), len(results2))

    for i in xrange(len(results1)):
      result1 = list(results1[i].nonzero()[0])
      result2 = list(results2[i].nonzero()[0])
      self.assertEqual(result1, result2,
        "Row {0} not equal: {1} vs. {2}".format(i, result1, result2))
  def testTMPyCpp(self):
    """
    Test compatibility between C++ and Python TM implementation.
    """
    results1 = createAndRunNetwork(TPRegion,
                                   "bottomUpOut",
                                   checkpointMidway=False,
                                   temporalImp="tm_cpp")

    results2 = createAndRunNetwork(TPRegion,
                                   "bottomUpOut",
                                   checkpointMidway=False,
                                   temporalImp="tm_py")

    self.compareArrayResults(results1, results2)
    def testSPRegion(self):
        results1 = createAndRunNetwork(SPRegion, "bottomUpOut")

        results2 = createAndRunNetwork(SPRegion,
                                       "bottomUpOut",
                                       checkpointMidway=True)

        self.assertEqual(len(results1), len(results2))

        for i in xrange(len(results1)):
            result1 = list(results1[i].nonzero()[0])
            result2 = list(results2[i].nonzero()[0])
            self.assertEqual(
                result1, result2,
                "Row {0} not equal: {1} vs. {2}".format(i, result1, result2))
    def testTMPyCpp(self):
        """
    Test compatibility between C++ and Python TM implementation.
    """
        results1 = createAndRunNetwork(TPRegion,
                                       "bottomUpOut",
                                       checkpointMidway=False,
                                       temporalImp="tm_cpp")

        results2 = createAndRunNetwork(TPRegion,
                                       "bottomUpOut",
                                       checkpointMidway=False,
                                       temporalImp="tm_py")

        self.compareArrayResults(results1, results2)
    def testTMPyCpp(self):
        """
    Test compatibility between C++ and Python TM implementation.
    """
        results1 = createAndRunNetwork(TPRegion,
                                       "bottomUpOut",
                                       checkpointMidway=False,
                                       temporalImp="tm_py")

        # temporalImp="tm_py" here is a temporary placeholder value until C++ TM is
        # finished, at which point it should be changed to "cpp"
        results2 = createAndRunNetwork(TPRegion,
                                       "bottomUpOut",
                                       checkpointMidway=False,
                                       temporalImp="tm_py")
        self.compareArrayResults(results1, results2)
  def testTMPyCpp(self):
    """
    Test compatibility between C++ and Python TM implementation.
    """
    results1 = createAndRunNetwork(TPRegion,
                                   "bottomUpOut",
                                   checkpointMidway=False,
                                   temporalImp="tm_py")

    # temporalImp="tm_py" here is a temporary placeholder value until C++ TM is
    # finished, at which point it should be changed to "cpp"
    results2 = createAndRunNetwork(TPRegion,
                                   "bottomUpOut",
                                   checkpointMidway=False,
                                   temporalImp="tm_py")
    self.compareArrayResults(results1, results2)