Menu

Few questions regarding the state of opensource HTM algorithms

Itay
2013-03-25
2013-04-01
  • Itay

    Itay - 2013-03-25

    Hi, My name is Itay, I have my own "htm" implementation in C# which was on the works. I do not consider myself experienced in HTM at all. My own implementation have some ideas that do not follow Numenta's guidelines carefully and I'm learning in some kind of a bit different technique.
    First of all, I think opening that forum on sourceforge is a great idea, especially since Numenta no longer support new users to sign up to the legacy forum (talking from personal experience)

    I have a few questions from experienced people such as who are involved in open source HTM projects and have some experience with the algorithm :

    1. Did any of the open source HTM algorithm succseed to produce good results? For all I've seen, I have tested a few implementations, and they all worked on a very simple toy problems, or were so complex I missed the point of their benchmarks at all. Let's not forget that the purpose of the HTM implementation is mainly to bring up the performance of the biological brain learning into a computer.

    2. I would like to discuss a certain problem which seems like was ignored for much time now. My algorithm can tackle this problem into a certain extent..
      let's say you have a region. The region can get inputs "A, B and C". now I would like the region to learn the following sequence : "ABBCBBA".. so that when I play the sequence repeatedly , like this : "ABBCBBA ABBCBBA ABBCBBA ABBCBBA" the region doesn't get confused and correctly predict that sequence.. So far I have tested binarybarry's C implementation for this kind of problem and It failed to predict it correctly.. would like to hear what do you think
      In my own benchmarks, The test region is made from 8 rows and 3 columns. for "A" , "B", or "C", the corresponding column is active from external. When testing this, I disable the spatial pooler and only test the temporal pooler.
      When showing repeating black and white pictures each is 100x100 pixels (that are similar in the "ABBCBBA" fashion) to the tempolar pooler (only) of binarybarry's C implementation, it failed to predict the sequence "ABBCBBA" successfully and instead was always making mistakes.

    I also would like to add something..
    When you have an input with a "fork" in it. such as "ABBCBBA" - after a "B", you can have either "A, B or C"
    I've read numenta were using a some kind of algorithm called "State splitting" algorithm in one of the research papers.
    This kind of algorithm uses centralized complex matrix to manage learning states of the entire region and how neurons should learn in the region. even more, that algorithm of the matrix manager is so complex that I highly doubt a real brain would use such an algorithm.
    Seems to me, this is not how biological brain learns.. biological brains are distributed and have local learning by nature.

    Thanks for the answers..

     

    Last edit: Itay 2013-03-25
    • Barry Matt

      Barry Matt - 2013-03-27

      Hi Itay,
      Can you be more specific about how that sequence failed exactly? What were you seeing for predictions instead? I just tried it and it seems to work. After presenting the sequence about 5 times, upon the 6th time each prediction correctly gets the next letter, including all the different B's.

      For my setup I used a region of size 25x25 with the spatial pooling hardcoded (meaning the spatial pooler is disabled and the input bits directly correspond to active columns). This way I test only the temporal sequencing. For representations, I create a 25x25 bit matrix where I set 40 random bits to be 1's using the letter from the input as the random seed (so the same letter will always produce the same representation).

      Let me remind you that if you have spatial learning turned on then yes you may not get good temporal predictions after a few training rounds depending your region parameters. If the spatial pooler learns too quickly it will change which columns represent a given input, which can break any previously learned temporal sequences. So be careful there.

      If you think the problem is somewhere else I would like to hear more details about your HTM run environment.

      By the way, thanks for trying my C implementation! Just a heads up, from here on out I will be focusing work on the OpenHTM project so be sure to check in occasionally to see our progress.

      Barry

       
      • Itay

        Itay - 2013-03-27

        Hi Barry, I have uploaded the code+images I'm using to the following address :
        http://www.speedyshare.com/jHq4E/rapidshare-upload.rar

        I also uploaded two videos showing you how the HTM region gets confused.
        http://youtu.be/d8LITtJd3OY - a video showing my C# passing 100x100 images to your library
        The output from your region was filtered for the most 500 active columns

        http://youtu.be/oKTnmHRRt24 - a video showing my c# passing 20x20 images to your library
        The output from your region was filtered for the most 30 active columns

        Basically what you see on the videos -
        on the left side, you see the original input that I send to the region
        on the right side, you see the prediction of your region, filtered by the most active columns.

        explanation regarding what's in the file :
        Image-1.bmp-Image-6.bmp are the images im using to feed the tempolar pooler of the region
        HTM_C is your (binarybarry) HTM C library converted to visual studio project in windows 64 bit
        slight modification of memory functions have been made in order to get it to compile..

        How im using your library is in this fashion :
        First, Im starting up my own C# project. my c# project is used as a sort of display, so that
        I can test your HTM region in real time and see it updating on the display instantly.
        The communication method is by files (the most simple way i could think of)
        after my C# application was started, I start your HTM library, which then waits for picture updates..
        I've injected myself into the file "unittests.cpp", you can see how I'm initializing the region there.
        the function i'm using to initialize your region is called newRegionHardcoded which I understand is without spatial pooler..
        basically, each picture update, I feed the picture data to your region, and then I count how many synapses predicted each column.
        I then provide a "mark" for each column so that I can later sort the most active columns by intensity.

        ConnectionWithCLIB.cs is the file im using from C# to sort and filter the columns by intensity, and then display it.

        Maybe i'm not using your HTM correctly... anyways waiting for your thoughts about this..

         
        • David Ragazzi

          David Ragazzi - 2013-03-27

          Hi Barry, I have uploaded the code+images I'm using to the following address :
          http://www.speedyshare.com/jHq4E/rapidshare-upload.rar

          Hi Itay, the link is not working. It ask for premium account even for simple downloads.

           
          • Nick

            Nick - 2013-03-27

            Try big "Download: rapidshare upload.rar" caption on the top

             
            • David Ragazzi

              David Ragazzi - 2013-03-27

              hahaha Oh my... the interface confused me.. thanks Nick

               
        • Itay

          Itay - 2013-03-30

          I also want to stay I just tried to play with it and change how I collect parameters about the prediction.. also double-checked things, it's the same thing. I'm now more confident that it's not working correctly.

           
          • Itay

            Itay - 2013-03-30

            Here some more videos , also showing my own "prototype algorithm" of the tempolar pooler for comparison :
            http://www.youtube.com/watch?v=osi4P9oyz3Y - input forking test (the same as before, just showing "ABBCBBA" repeatedly..) but this time using my prototype algorithm, you can now see how it's supposed to be predicted.. no confusion. 20x20 pixels and showing the best 30 columns.

            http://www.youtube.com/watch?v=XUX1X4tMeEk - Jumping ball test, testing this time BinarryBarry's C Implementation. the jumping ball test allows to see if the tempolar pooler can learn complex real world sequences. this time the context forking gets even more intense. You can see that the tempolar pooler gets confused and the result is not very clear ball prediction - with a lot of noise. the tempolar pooler can't decide whether an "A" comes after the "B", or a "C" comes after the "B", or whether it's just another "B".. I used 30 cells per column, image and region size are 40x40 pixels showing the most 50 intense columns.

            http://www.youtube.com/watch?v=aLRxzeH5Uk0 - showing my prototype algorithm on the same jumping ball scene. See 0:10-0:15 seconds for a real clear ball prediction. Afterwards the algorithm stops working good because of various complicated reasons and the video capturing is getting choppy. Image and region size are 40x40 pixels showing the most 50 intense columns.

             
    • Doug King

      Doug King - 2013-03-27
      1. Did any of the open source HTM algorithm succseed to produce good results? For all I've seen, I have tested a few implementations, and they all worked on a very simple toy problems, or were so complex I missed the point of their benchmarks at all. Let's not forget that the purpose of the HTM implementation is mainly to bring up the performance of the biological brain learning into a computer.

      Hi Itay,

      This is a very good question and the answer is not possible to give I think because we have no methodology to reproduce testing and to compare results across HTM implementations. This is one of the goals of this project and the tools would be the following (some we do not have yet)

      1. A standard implementation of the CLA that can be extended, but the core CLA implementation remains stable (we have CLA version according to Numenta paper)
      2. A way to save and share settings for key parameters of the CLA (we have this now)
      3. A way to save and share configuration of multiple region hierarchys setup. (To do)
      4. A way to share input (file, stream, etc.) so we can reproduce results with same input. (almost done)
      5. A way to "fix" the random parts of the HTM so we can force exact reproduction for testing various tweaks to settings and algorithms. This would mean for testing and comparing we could set the seed for the generator and set it to be 'pseudo random' or deterministic.
      6. A way to monitor and save results of training / learning as statistics that can be compared. (TO do)

      Once we do these things we can really move forward in optimizing the CLA and optimizing performance on other platforms such as parallizing code, using a GPU, etc. In short, we need a reproducible chain of input-settings-output that can be shared and compared.

      I have faith the the CLA works on some level, but hard proof as to how well it works, what settings to use, type of input, and amount of training (cpu cycles) is not something that we can benchmark. I suspect certain settings are critical to optimize, number of training cycles may be more than we think to get good results, and the problems we are training / testing on (letter sequences) are not the best fit for HTM. I could be wrong about some of these things, but it's hard to do any 'scientific' testing at this point to prove any of this.

      Our team is spinning up fast and is making a lot of progress in these areas. We are looking for passionate team members that have coding skills and the understanding of the issues that the CLA and HTM theory present. I think you might be good match :-) especially if you have already coded your own HTM and worked to improve the CLA. Would you like to join our efforts?

      -Doug

       
      • Itay

        Itay - 2013-03-29

        Hi Doug,
        This is my second time I post here.. the last post just didn't show up.
        Yes I would like to join the project to join efforts in what I think will be important..
        But first I'm waiting for BinaryBarry's repsonse. If I'm wrong here, then I don't have much to contribute, since I don't really know to-the-details the current CLA implementation. The reason I skipped details is that the Numenta document was so un-clear that I couldn't imagine it working and instead went for my own vision. If I'm right, it means that the tempolar pooler is broken and you can't even form the simplest sequences. I also don't get how you are all so enthusiastic to standardize and expand the algorithm to higher regions and top-down feedback and lots of other new stuff. If you look at Numenta, you see it's not doing it's best.. look how a team of experts get stuck at improving the algorithm of a simple region for an entire year. And if numenta got stuck, what makes people here think you can expand the algorithm and expect it to work. I wonder if anyone used the current implementation of the algorithm for a practical problem? Did any of you found the algorithm to be helpful?

         

        Last edit: Doug King 2013-03-29
        • Doug King

          Doug King - 2013-03-29

          Good questions again. Also I have lost posts too. I now edit them in notepad just in case :-)

          Why we are enthusiastic? - I am speaking for myself but I think members of the group share some of my feelings - Numenta is getting good results. Good enough for launching a commercial app, and according to some info in lectures by Jeff Hawkins they are getting a much higher rate of prediction than existing methods. The breakthrough from the older versions of the CLA was the introduction of sparse encoding. It took Numenta some time but I think now the key features of the CLA are stable and working for Numenta.

          With our project standardizing on a common API / data structure for settings and more importantly save/load a trained network will pay back in a huge way by allowing trained HTMs to be shared. I expect some HTMs will be trained for months on certain problems before they get good at predicting. By sharing highly trained HTMs the community can leverage many CPU-Years of computing power in a way similar to SETI At Home and Protein Folding. By having a common API for the hierarchy we will be able to choose from many trained HTMs and combine and configure them in a new way to solve new problems. None of this can be done without a community of users on a common 'platform'.

          The current version of our CLA has not been proved to 'work' at this point. I may be wrong, somebody speak up if you have some repeatable results we can verify. Your criticism of the current state of openHTM CLA implementation is a valid one. I don't think that means we will not get this working.

          An analogy to the first airplane is a good one. Before the Wright brothers, many people tried to make flying machines that had flapping wings, feathers, etc. Then it was discovered that the cross section shape of a bird wing was really the only thing that mattered. The first airplanes were 'toys' and did nothing practical. The power of the internal combustion engine was not much either. However, increase in power for engines, common parts and knowledge about the wing were shared and soon we had airplanes that could do useful things. I believe we are in a similar place with biologically inspired computation.

          I think Numenta has extracted the most relevant principles from neuro-biology and simulated them with the CLA. I think Numenta is getting results with the current CLA as it is described in the paper (check out some recent lectures by Jeff Hawkins). I don't think they have any new secrets that they are not talking about, just a refinement of what they have already published, plus a better understanding of the problem space and what types of problems are best solved by the CLA (pattern prediction) and a good understanding of how to encode inputs to the HTM to get good results. This is important too, and I see a lot of speculation about HTMs doing things that I think are not a good fit, or which are problems for too high a level of abstraction to solve yet. Simple inputs such as temperature change over time, varying electrical signals, etc. are a good fit for HTMs to get results with.

          So to sum up, I am optimistic we are on the correct path, we will get usable results with the CLA soon, and we will create a common platform for sharing and connecting trained HTMs. With increases in CPU power doubling I see the promise of biologically inspired computing to be obtained not too far in the future.

          I welcome critical thinking. I appreciate you challenging us to show results. I agree our implementation of the CLA may be 'broken' but I am expecting we will have measurable results within 30-60 days at this rate. We are also counting on Barry to help improve some of the CLA. We have an early fork of his code and he claims that he has fixed a number of things since then, so your conversation with him might help point us in the right direction.

           
          • Nick

            Nick - 2013-03-30

            Hi all,
            my answer is just about loosing posts :)
            Looks like this happens when your address string contains a part with the "limit" parameter (at least for me).
            When I remove just this part, everything works OK.

             
          • Itay

            Itay - 2013-03-30

            What an aura of optimism is emitting from you :)

            I think what can make us the most optimists is the fact that such algorithm exists in nature, and therefore it can exist in a machine.
            I just wish there was a direct data or conversations with brain researchers we could use, where the neurons in the neurocortex are being sampled and that all their connections are being monitored. Right now we are working with some principles that come from numenta, that most probably are a very good base (since they are using the same principles for three years now) but really it's stepping in the dark..

            First I think it's better if we (or you) will make sure the spatial pooler and tempolar pooler are working 100% like they should work according to the base principles from numenta - what they show in the lectures.. test them, document them, benchmark them before moving to more advanced subjects (such as top down feedback and so forth)

            I sure hope that there will be advancement of the open source CLA algorithm, with all the thinking power that's condensed in this project. and hopefully indeed within 30-60 days

             
            • Barry Matt

              Barry Matt - 2013-03-30

              Hi Itay,
              You are right that we still have much to prove. I would consider HTM still very much a research project. With that said, the HTM as exists can learn sequences so long as the input data is in the appropriate form (that is it exists in a nice sparse distributed representation). So far however the HTM really has only been shown to work with relatively simple data. The kind where the data and the sequences thereof are very basic. This is where Numenta is first focusing their efforts with Grok, things like monitoring temperture sensors over time, utility usage over time, server payload over time etc. These situations involve simple data inputs, usually just a small set of numbers, and the sequences are rather simple "temperature increases from 9am-2pm every day".

              This may seem rather small but the value here is the fact that HTM has live learning and makes predictions in real time. This is quite a big difference from most systems that analyze historical data into a fixed model that is used for predictions. If the data changes the entire model has to be recalculated from scratch. HTM learns as it goes along. It has bias for recent data over old data. The model never has to be "rebuilt" because instead it is being updated to reflect new data in real time. This is a big advantage that allows faster/earlier and more accurate predictions for real time data streams.

              A lot of us are enthusiatic because we recognize a lot of potential here. There is still much work to be done but the idea of data in SDR format makes it easy to perform data comparisons so similar data can make meaningful predictions even if that exact input was never seen before. We like the idea of sequences being learned and updated in real time as new data arrives. It is tantalizing to see predictions being made constantly so the system can react to things before they happen. It is interesting to consider that regions may connect to each other in a hierarchy so larger and more complex elements and higher level sequences could potentially work that way.

              All this inspired by data from neuroscience. With that said, there is a lot of work to be done. The HTM has only been shown to work with very simple data so far. You are right, it does not work with complex things like images, language, audio or any of the data that real brains deal with. There are lots of missing pieces yet to be figured out here. But we have to start somewhere, and those of us who are working with HTM believe the concept itself seems to hold a lot of promise. It may not do everything a full neocortex can do, but it feels to be in the right direction at least.

              With OpenHTM we hope to create a standardized implementation with shared API and file formats to help make HTM research easier for others who are interested. We hope to get the project working at least with some simple example data streams similar to those being used in Grok. The code is still early and stabilizing so we are not there yet but we are trying!

              Barry

               
              • Itay

                Itay - 2013-03-30

                Hi barry, indeed, there is a long way to go and I agree that it's a step in the right direction.
                Wouldn't you also prefer to fix what's broken in the current CLA and research into possible solutions?
                also, you still haven't responded to my questions regarding the temporal pooler.. please respond there :)

                 
                • Barry Matt

                  Barry Matt - 2013-03-31

                  Sorry you are right, you have been waiting for another response. I have taken a look at your code and your results and you are right that it looks wrong. I will need to do some detailed debugging to determine what exactly is not right so I will need some time.

                  I have been doing some work porting code from my C version to OpenHTM. A lot of that is now in. So I would like to try to reproduce your example as a test case for OpenHTM. There is a little more work to get OpenHTM ready for this, so please be patient but if I can get things working we can use this as a good example test case for OpenHTM.

                  I will let you know right away once I have results to report. Thanks for the clear example and code for exactly what you are doing, that helps a lot!

                  Barry

                   
            • Doug King

              Doug King - 2013-04-01

              I think Jeff Hawkins is an optimist too :-)

              test them, document them, benchmark

              Yes. We can't move forward if we don't do this.

               
  • David Ragazzi

    David Ragazzi - 2013-03-26

    Hi Itay,

    1. Did any of the open source HTM algorithm succseed to produce good results? For all I've seen, I have tested a few implementations, and they all worked on a very simple toy problems, or were so complex I missed the point of their benchmarks at all. Let's not forget that the purpose of the HTM implementation is mainly to bring up the performance of the biological brain learning into a computer.

    I believe that these toy problems are due to lack of Numenta support to stimulate third projects after its initial phase as startup. I do not blame them, because they themselves were in an uncomfortable situation to continue to prove the value of its algorithm. They themselves were concentrating on creating business value in order to they could not give attention to the community. Customers pressure startups companies for results. So when the HTM began creating commercial value, OBVIOUSLY they closed their plans in order to receive the return on investment and avoid competition. That's why we know only the toys. Our idea is follow the same path of Numenta and create value (not necessarily business value) and we have people sharing their networks freely.

    Another thing, I think that a single HTM itself is not powerful, but when they are integrated is other business.... Think of a single a HTM which receives inputs from 2 different sensors. When this happens, HTM can discover a lot of cause-effects relations. Software like machine-translation can be build (as they use an similar hierarchical architecture, see BIA+ model), market trends can be detected when a sensor as sales and other factores are learned together, and so on. I agree with you in many points that many tecniques cannot be brain-like, however this is one that I more see similarity with brain, ie a sight stimulus can activate other caracteristics of a same object as sound, touch.

    However before this dream happens, we have a lot of work to do including passing correct input to higher regions, top-down activaction to lower regions or other regions, and a better temporal pooler.

    Cheers, David

    Obs: In cognitive and computational science, we call of Ontology the study of representation/concept of any object which is composed by features as shapes, sounds, actions, etc, and its relations to other concepts. So when you think, you compare a concept with other, to realize inferences. I mean any sensor in HTM could activate a piece of an ontological concept and once HTM has the great picture of the object, it would extent its analogies with related sensors. This works like logical reason to solve problems and even activate (good and bad) emotions retated to a concept.

     

    Last edit: David Ragazzi 2013-03-27
  • David Ragazzi

    David Ragazzi - 2013-03-26

    I would like to discuss a certain problem which seems like was ignored for much time now. My algorithm can tackle this problem into a certain extent..
    let's say you have a region. The region can get inputs "A, B and C". now I would like the region to learn the following sequence : "ABBCBBA".. so that when I play the sequence repeatedly , like this : "ABBCBBA ABBCBBA ABBCBBA ABBCBBA" the region doesn't get confused and correctly predict that sequence.. So far I have tested binarybarry's C implementation for this kind of problem and It failed to predict it correctly.. would like to hear what do you think
    In my own benchmarks, The test region is made from 8 rows and 3 columns. for "A" , "B", or "C", the corresponding column is active from external. When testing this, I disable the spatial pooler and only test the temporal pooler.
    When showing repeating black and white pictures each is 100x100 pixels (that are similar in the "ABBCBBA" fashion) to the tempolar pooler (only) of binarybarry's C implementation, it failed to predict the sequence "ABBCBBA" successfully and instead was always making mistakes.

    I think although the current project state is a good progress, it still lacks of some bit improvements as these you mentioned. We can predicts short sequences, but not long. Just because this we create the comunity: for each one can contribute with individual insights. Looks great your algorithm already predict correctly, would be (very) nice if you can share your algorithm in order to we study and add yours insights to the current project. Furthermore, we do need developers, if you wish, please let us know.

    I've read numenta were using a some kind of algorithm called "State splitting" algorithm in one of the research papers.

    I don't know this technique, however I belive it is palliative, ie just to help the learning while they don't have a better biological tecnique to address this issue.

     

Log in to post a comment.

MongoDB Logo MongoDB