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>
>> >
>> >
>>
>>

Reply via email to