-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Create a simple tutorial app for using nupic #654
Comments
I would like to help. I suppose I can get some help at IRC |
Sure thing, @Lonesword. I am usually on IRC (rhyolight). I'll assign this issue to you once you've signed our contributor license. Let's discuss your ideas here on this ticket. |
Contributor license signed. |
Thanks @Lonesword, you've been assigned this issue. Do you have any thoughts about the tutorial? |
For the hello world equivalent, how about making nupic learn an "ABCD" sequence (.flat file maybe?) and predict the next output when the user inputs an alphabet? |
@Lonesword An interactive tutorial like that sounds like a great idea. Brainstorming a bit, there are two different levels we could go with for a hello world tutorial:
I think both are valuable. Any thoughts on this? Other approaches? Do you want to work on 1) for now? |
@subutai I would like to work on 1). I believe such a low level example do not exist On Thu, Feb 20, 2014 at 1:27 AM, Subutai Ahmad notifications@github.comwrote:
|
Also, the TP class is defined in some python file, I believe. I'm afraid I On Fri, Feb 21, 2014 at 9:16 AM, Kevin Martin
|
@Lonesword The SP is in Great that you want to work on 1). I'll create a separate issue to track task 2) then. This issue will track 1). |
I created issue #667 to track 2). |
@subutai https://github.com/lonesword/nupichelloworld The error was : File I don't know why this should happen. The numpy array I created is 1024 numInputs = numpy.array(inputShape).prod() and, inputShape=(32,32). When I ran numpy.array((32,32)).prod() in the python interactive shell, it I do not know what went wrong. On Sat, Feb 22, 2014 at 12:38 AM, Subutai Ahmad notifications@github.comwrote:
|
I would also want to add that I did not understand the last parameter of compute(self,inputArray,learn,activeArray) What is activeArray? The first two had explanations as comment. |
just i quick glance.. On Sat, Feb 22, 2014 at 11:37 AM, lonesword notifications@github.comwrote:
|
The compute() function in spatial_pooler.py file had activeArray It says : Thank you. On Sat, Feb 22, 2014 at 4:12 PM, breznak notifications@github.com wrote:
|
Sorry. I made a mistake. I had initialized FlatSpatialPooler to work with 4 On Sat, Feb 22, 2014 at 4:20 PM, Kevin Martin
|
I have written a simple program that accepts an input vector and prints the list of columns that are active after inhibition. Any suggestions as to how to proceed from here? The link : https://github.com/lonesword/nupichelloworld/blob/master/helloworld.py |
@Lonesword That's great! I also saw your post on the ML. This weekend has been very busy for me but I will take a look at it soon, hopefully later today or tomorrow. |
@Lonesword We are actually in the process of removing FlatSpatialPooler (see issue #627) so using the SpatialPooler would be ideal. You are right that the same input vector should usually result in the same output, but since the system is always learning that property is not always guaranteed. For example, with boosting you could have some columns "steal" patterns from other columns. Looking through the code in the github repo I notice that in these lines a new random vector gets created before each call to example.run:
In this case you would definitely see new output for each input. A couple of other suggestions: You can use the Also with numpy you can do |
Thanks for the help. Yes, a random input vector gets created in the code for i in range(10): Here the same testinput is given as the inputArray 10 times and I got On Tue, Feb 25, 2014 at 4:01 AM, Subutai Ahmad notifications@github.comwrote:
|
The hello world program [1] now works with the SpatialPooler. The code has [1] https://github.com/lonesword/nupichelloworld/blob/master/helloworld.py On Tue, Feb 25, 2014 at 9:16 AM, Kevin Martin
|
Great job, Kevin! :) Matt Taylor On Tue, Feb 25, 2014 at 10:11 AM, lonesword notifications@github.comwrote:
|
Hi @Lonesword - nice! I understand your earlier comments now. I pulled your latest code and made a couple of changes. There are a couple of options to set when you want to use a flat SP (no topology). In those cases it is much faster. The options are I also changed a couple of other things. First, I set the sparsity to be about 2% which is what we typically use (by setting Try it out and see if this makes sense!! Here are my changes:
|
I have made the suggested changes. The active columns are listed much On Wed, Feb 26, 2014 at 7:19 AM, Subutai Ahmad notifications@github.comwrote:
|
@Lonesword Great! Yes, we can extend it to show the next prediction. To do this we will need to include the temporal pooler and have it learn sequences. Turns out you can actually bypass the encoders if you want, and just train it on random sequences. The sequence learning can learn random sequences. (The code in If you want to stick with the spatial pooler you can try adding some noise to the input pattern and see how the columns change. For example, if you add 10% noise, how much do the columns change? |
@Lonesword Hi Kevin - just wondering if you plan to continue this? Even as-is I think your code could be very helpful to NuPIC users and useful to have in our examples directory. If you add in code to explore the effect of noise (or some other property) it could be really interesting. |
Oh I'm sorry that I kept everyone waiting. It had been a busy week for me. On Tue, Mar 4, 2014 at 10:20 PM, Subutai Ahmad notifications@github.comwrote:
|
@Lonesword No worries. Take your time - happy to have your stuff in whenever! |
Effect of noise added. Please check the link [1] [1] https://github.com/lonesword/nupichelloworld/blob/master/helloworld.py On Tue, Mar 4, 2014 at 11:57 PM, Subutai Ahmad notifications@github.comwrote:
|
@Lonesword Great! I ran it and it worked well. I think this will be very helpful to others, as you've probably guessed from some of the recent mailing list messages. @rhyolight Should we add this as an example under |
@Lonesword Can you fork nupic and add your example to the examples directory and submit a PR? If you need help with this, email me. |
@Lonesword I played around with this a little, and when I bumped up the number of iterations on this line, to Great example btw! |
@traun Thank you! I did not know that before. @rhyolight : I'm having issues with my internet usage limits. I'll add it On Sun, Mar 9, 2014 at 12:02 AM, Traun Leyden notifications@github.comwrote:
|
|
Here's what I have done :
Anything happened at the other end? On Sun, Mar 9, 2014 at 2:57 AM, breznak notifications@github.com wrote:
|
Great, thanks! Yes, I saw the pull request - looks like you did everything correctly. I'll probably have a few minor comments regarding code format, which I'll do on that PR. |
Sure. Glad that I got it right :) On Sun, Mar 9, 2014 at 10:09 PM, Subutai Ahmad notifications@github.comwrote:
|
This should be extremely newbie-friendly and as simple as possible. It should include a flat file that will be used as input data, and step-by-step instructions (assuming nupic is already installed) on how to write a python program that gets that data into nupic and analyzes the output predictions and does something useful with them.
This could start as a wiki, but should eventually go into some official docs on numenta.org or within the repo.
The text was updated successfully, but these errors were encountered: