def mmGetCellActivityPlot(self, title=None, showReset=False, resetShading=0.25): """ Returns plot of the cell activity. @param title an optional title for the figure @param showReset if true, the first set of cell activities after a reset will have a gray background @param resetShading If showReset is true, this float specifies the intensity of the reset background with 0.0 being white and 1.0 being black @return (Plot) plot """ plot = Plot(self, title) resetTrace = self.mmGetTraceResets().data activeCellTrace = self._mmTraces["activeCells"].data data = numpy.zeros((self._numColumns, 1)) for i in xrange(len(activeCellTrace)): if showReset and resetTrace[i]: activity = numpy.ones((self._numColumns, 1)) * resetShading else: activity = numpy.zeros((self._numColumns, 1)) activeSet = activeCellTrace[i] activity[list(activeSet)] = 1 data = numpy.concatenate((data, activity), 1) plot.add2DArray(data, xlabel="Time", ylabel="Cell Activity") return plot
def mmGetPermanencesPlot(self, title=None): """ Returns plot of column permanences. @param title an optional title for the figure @return (Plot) plot """ plot = Plot(self, title) data = numpy.zeros((self.getNumColumns(), self.getNumInputs())) for i in xrange(self.getNumColumns()): self.getPermanence(i, data[i]) plot.add2DArray(data, xlabel="Permanences", ylabel="Column") return plot
def mmGetPermanencesPlot(self, title=None): """ Returns plot of column permanences. @param title an optional title for the figure @return (Plot) plot """ plot = Plot(self, title) data = numpy.zeros((self.getNumColumns(), self.getNumInputs())) for i in xrange(self.getNumColumns()): self.getPermanence(i, data[i]) plot.add2DArray(data, xlabel="Permanences", ylabel="Column") return plot
def mmGetCellTracePlot(self, cellTrace, cellCount, activityType, title="", showReset=False, resetShading=0.25): """ Returns plot of the cell activity. Note that if many timesteps of activities are input, matplotlib's image interpolation may omit activities (columns in the image). @param cellTrace (list) a temporally ordered list of sets of cell activities @param cellCount (int) number of cells in the space being rendered @param activityType (string) type of cell activity being displayed @param title (string) an optional title for the figure @param showReset (bool) if true, the first set of cell activities after a reset will have a grayscale background @param resetShading (float) applicable if showReset is true, specifies the intensity of the reset background with 0.0 being white and 1.0 being black @return (Plot) plot """ plot = Plot(self, title) resetTrace = self.mmGetTraceResets().data data = numpy.zeros((cellCount, 1)) for i in xrange(len(cellTrace)): # Set up a "background" vector that is shaded or blank if showReset and resetTrace[i]: activity = numpy.ones((cellCount, 1)) * resetShading else: activity = numpy.zeros((cellCount, 1)) activeIndices = cellTrace[i] activity[list(activeIndices)] = 1 data = numpy.concatenate((data, activity), 1) plot.add2DArray(data, xlabel="Time", ylabel=activityType, name=title) return plot
def mmGetCellTracePlot(self, cellTrace, cellCount, activityType, title="", showReset=False, resetShading=0.25): """ Returns plot of the cell activity. Note that if many timesteps of activities are input, matplotlib's image interpolation may omit activities (columns in the image). @param cellTrace (list) a temporally ordered list of sets of cell activities @param cellCount (int) number of cells in the space being rendered @param activityType (string) type of cell activity being displayed @param title (string) an optional title for the figure @param showReset (bool) if true, the first set of cell activities after a reset will have a grayscale background @param resetShading (float) applicable if showReset is true, specifies the intensity of the reset background with 0.0 being white and 1.0 being black @return (Plot) plot """ plot = Plot(self, title) resetTrace = self.mmGetTraceResets().data data = numpy.zeros((cellCount, 1)) for i in xrange(len(cellTrace)): # Set up a "background" vector that is shaded or blank if showReset and resetTrace[i]: activity = numpy.ones((cellCount, 1)) * resetShading else: activity = numpy.zeros((cellCount, 1)) activeIndices = cellTrace[i] activity[list(activeIndices)] = 1 data = numpy.concatenate((data, activity), 1) plot.add2DArray(data, xlabel="Time", ylabel=activityType) return plot