def testCreateFromTraceExcludeResets(self):
   resetTrace = BoolsTrace(self, "resets")
   resetTrace.data = [True, False, False, True, False, False]
   metric = Metric.createFromTrace(self.trace, excludeResets=resetTrace)
   self.assertEqual(metric.title, self.trace.title)
   self.assertEqual(metric.min, 0)
   self.assertEqual(metric.max, 5)
   self.assertEqual(metric.sum, 10)
   self.assertEqual(metric.mean, 2.5)
   self.assertEqual(metric.standardDeviation, 1.8027756377319946)
  def mmClearHistory(self):
    super(TemporalPoolerMonitorMixin, self).mmClearHistory()

    self._mmTraces["activeCells"] = IndicesTrace(self, "active cells")
    self._mmTraces["sequenceLabels"] = StringsTrace(self, "sequence labels")
    self._mmTraces["resets"] = BoolsTrace(self, "resets")

    self._sequenceRepresentationDataStale = True
    def mmClearHistory(self):
        super(SpatialPoolerMonitorMixin, self).mmClearHistory()

        self._mmTraces["activeColumns"] = IndicesTrace(self, "active columns")
        self._mmTraces["activeInputs"] = IndicesTrace(self, "active inputs")
        self._mmTraces["numConnections"] = CountsTrace(self, "connections")
        self._mmTraces["learn"] = BoolsTrace(self, "learn")

        initialPermanence = numpy.zeros((self._numColumns, self._numInputs),
                                        dtype=realDType)
        for c in range(self._numColumns):
            self.getPermanence(c, initialPermanence[c, :])

        self._mmData["initialPermanence"] = initialPermanence
    def mmClearHistory(self):
        super(TemporalMemoryMonitorMixin, self).mmClearHistory()

        self._mmTraces["predictedCells"] = IndicesTrace(
            self, "predicted cells")
        self._mmTraces["activeColumns"] = IndicesTrace(self, "active columns")
        self._mmTraces["predictiveCells"] = IndicesTrace(
            self, "predictive cells")
        self._mmTraces["numSegments"] = CountsTrace(self, "# segments")
        self._mmTraces["numSynapses"] = CountsTrace(self, "# synapses")
        self._mmTraces["sequenceLabels"] = StringsTrace(
            self, "sequence labels")
        self._mmTraces["resets"] = BoolsTrace(self, "resets")

        self._mmTransitionTracesStale = True
  def mmClearHistory(self):
    super(UnionTemporalPoolerMonitorMixin, self).mmClearHistory()

    self._mmTraces["unionSDR"] = IndicesTrace(self, "union SDR")
    self._mmTraces["sequenceLabels"] = StringsTrace(self, "sequence labels")
    self._mmTraces["resets"] = BoolsTrace(self, "resets")
    self._mmTraces["connectionsPerColumnMetric"] = MetricsTrace(
      self, "connections per column (metric)")

    self._mmData["unionSDRDutyCycle"] = numpy.zeros(self.getNumColumns(), dtype=realDType)
    self._mmData["persistenceDutyCycle"] = numpy.zeros(self.getNumColumns(), dtype=realDType)

    self._mmTraces["numConnections"] = CountsTrace(self, "connections")

    self._sequenceRepresentationDataStale = True
Beispiel #6
0
    def mmClearHistory(self):
        super(ColumnPoolerMonitorMixin, self).mmClearHistory()

        self._mmTraces["activeCells"] = IndicesTrace(self, "active cells")
        self._mmTraces["numDistalSegments"] = CountsTrace(
            self, "# distal segments")
        self._mmTraces["numDistalSynapses"] = CountsTrace(
            self, "# distal synapses")
        self._mmTraces["numConnectedDistalSynapses"] = CountsTrace(
            self, "# connected distal synapses")
        self._mmTraces["numProximalSynapses"] = CountsTrace(
            self, "# proximal synapses")
        self._mmTraces["numConnectedProximalSynapses"] = CountsTrace(
            self, "# connected proximal synapses")
        self._mmTraces["sequenceLabels"] = StringsTrace(
            self, "sequence labels")
        self._mmTraces["resets"] = BoolsTrace(self, "resets")
        self._mmTransitionTracesStale = True