Actually, I just resolved that issue and merged. If you pull the latest code and try again, it should work.
On Mon, Oct 27, 2014 at 8:50 PM, Chetan Surpur <[email protected]> wrote: > Mika, > In nupic.cerebro2.server, did you run `python server.py 9090`? > See this issue: https://github.com/numenta/nupic.cerebro2/issues/65 > - Chetan > On Mon, Oct 27, 2014 at 8:11 PM, Mika Schiller <[email protected]> > wrote: >> Chetan, the code runs fine now, though there is still no simulation showing >> at http://localhost:8000/ >> I've attached a screenshot of my javascript console. Seems it might be >> related to a javascript issue. >> On Mon, Oct 27, 2014 at 8:25 PM, Chetan Surpur <[email protected]> wrote: >>> Hi Mika, >>> >>> I just merged a PR [1] that should resolve this issue. Please update and >>> try it again. >>> >>> [1] https://github.com/numenta/nupic.cerebro2.server/pull/14 >>> >>> Thanks, >>> Chetan >>> >>> >>> >>> On Mon, Oct 27, 2014 at 4:25 PM, Mika Schiller <[email protected]> >>> wrote: >>> >>>> Woops, accidentally hit send. Here is the corrected code to run the >>>> patched sp >>>> >>>> >>>> from nupic.encoders import ScalarEncoder >>>>> >>>>> from nupic.research.spatial_pooler import SpatialPooler >>>>> >>>>> import numpy >>>>> >>>>> from patcher import Patcher >>>>> >>>>> >>>>>> #create an encoder >>>>> >>>>> encoder = ScalarEncoder(n=22, w=3, minval=2.5, maxval=97.5, >>>>>> clipInput=True, forced=True) >>>>> >>>>> >>>>>> #create a spatial pooler >>>>> >>>>> sp = SpatialPooler(inputDimensions=(22), >>>>> >>>>> columnDimensions=(4,), potentialRadius=22, numActiveColumnsPerInhArea=1, >>>>> >>>>> globalInhibition=True, synPermActiveInc=0.03, potentialPct=1.0) >>>>> >>>>> >>>>>> Patcher().patchSP(sp) >>>>>> >>>>> >>>>>> #make sp learn input 20 times >>>>> >>>>> output = numpy.zeros((4,), dtype='int') >>>>> >>>>> for _ in xrange(20): >>>>> >>>>> sp.compute(encoder.encode(1), learn=True, activeArray=output) >>>>> >>>>> >>>> >>>>> >>>>> >>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>> On Mon, Oct 27, 2014 at 5:35 PM, Matthew Taylor <[email protected]> wrote: >>>> >>>>> Mika, did Chetan's tip to patch the SP before running Cerebro fix your >>>>> problem? >>>>> --------- >>>>> Matt Taylor >>>>> OS Community Flag-Bearer >>>>> Numenta >>>>> >>>>> >>>>> On Mon, Oct 20, 2014 at 9:15 PM, Chetan Surpur <[email protected]> >>>>> wrote: >>>>> > Ah, so you have to patch the SP >>>>> > before >>>>> > you run it. >>>>> > >>>>> > >>>>> > >>>>> > On Sun, Oct 19, 2014 at 4:12 PM, Mika Schiller <[email protected] >>>>> > >>>>> > wrote: >>>>> >> >>>>> >> I'm trying to make the sp learn an input 20 times as you can see in >>>>> the >>>>> >> code below. First I go into nupic.cerebro2.server directory and run >>>>> python >>>>> >> server.py 9090. Then I go into nupic.cerebro2 directory, then /static >>>>> and >>>>> >> then run python -m SimpleHTTPServer 8000. When I go to >>>>> >> http://localhost:8000/ I see the display, but no cells or anything. >>>>> I've >>>>> >> attached a screenshot of what I'm seeing. Any idea what might be >>>>> going on >>>>> >> here? Did I patch the sp correctly? Thanks! >>>>> >> >>>>> >>>> >>>>> >>>> from nupic.encoders import ScalarEncoder >>>>> >>>> >>>>> >>>> from nupic.research.spatial_pooler import SpatialPooler >>>>> >>>> >>>>> >>>> import numpy >>>>> >>>> >>>>> >>>> from patcher import Patcher >>>>> >>>> >>>>> >>>> >>>>> >>>> #create an encoder >>>>> >>>> >>>>> >>>> encoder = ScalarEncoder(n=22, w=3, minval=2.5, maxval=97.5, >>>>> >>>> clipInput=True, forced=True) >>>>> >>>> >>>>> >>>> >>>>> >>>> #create a spatial pooler >>>>> >>>> >>>>> >>>> sp = SpatialPooler(inputDimensions=(22), >>>>> >>>> >>>>> >>>> columnDimensions=(4,), potentialRadius=22, >>>>> numActiveColumnsPerInhArea=1, >>>>> >>>> >>>>> >>>> globalInhibition=True, synPermActiveInc=0.03, potentialPct=1.0) >>>>> >>>> >>>>> >>>> >>>>> >>>> >>>>> >>>> >>>>> >>>> #make sp learn input 20 times >>>>> >>>> >>>>> >>>> output = numpy.zeros((4,), dtype='int') >>>>> >>>> >>>>> >>>> for _ in xrange(20): >>>>> >>>> >>>>> >>>> sp.compute(encoder.encode(1), learn=True, activeArray=output) >>>>> >> >>>>> >> >>>>> >>>> >>>>> >>>> >>>>> >>>> >>>>> >>>> if __name__ == "__main__": >>>>> >>>> >>>>> >>>> >>>>> >>>> >>>>> >>>> Patcher().patchSP(sp) >>>>> >> >>>>> >> >>>>> >> <Screen Shot 2014-10-19 at 7.08.50 PM.png> >>>>> > >>>>> > >>>>> >>>>> >>>> >>>
