Thursday, April 21, 2011

Coding Again

Writing Code for Animal

I'm programming again. Yesterday, I dusted off the last incarnation of Animal, my intelligent computer chess project, and fired up Visual C# for Windows. Not surprisingly, it's taking me a little time to readjust to C#, Microsoft's .net environment and, of course, my old code. I chose C# because it is a better and faster C++ type language, and I am good with C++. I picked the Microsoft XNA Game Studio environment because it will make Animal compatible with three computing platforms: Windows, Xbox 360 and Windows Phone. Converting it afterwards to run on Apple's IPad or an Android device should not be too hard.

Using my much improved understanding of the brain as a guide, I have already decided to delete several old memory classes from the project. First of all, I need to design a brand new tree of knowledge, including both leaf and branch nodes and various auxiliary classes. I will also need a new pain and pleasure module and I will have to modify the motor layer for faster motor learning and better motor coordination. Finally, I need to debug the load and save module. It's all slow going (I don't have much spare time) but I've learned to be patient over the years.

I'll let you know how I'm progressing. Hang in there.

Sunday, April 17, 2011

Intelligent Computer Chess, Part IX

Part I, II, III, IV, V, VI, VII, VIII, IX

Abstract

In Part VIII, I explained the difference between long-term and short-term memory. I described how effectors and actuators work and I wrote that the concept of complementarity can be used to design a coordinated motor system free of conflicts. In today's post, I explain how to connect the tree of knowledge to the motor system in a way that will generate intelligent motor behavior in a changing environment.

The Intelligent Behaving System

Intelligent sensorimotor behavior is a process that involves a feedback loop as follows:
  1. Changes in the environment are picked up by complementary sensors.
  2. The sensors generate signal streams that are fed into a signal separator.
  3. The separator separates the streams into meaningful signals which are fed into a pattern recognizer.
  4. The recognizer detects patterns and generates signals that are sent to a stream assembler.
  5. The assembler combines the signals into streams which are fed to complementary effectors.
  6. The effectors cause changes in the environment and the cycle begins anew.
The following diagram shows the bare minimum that is necessary for coherent behavior.
The important thing to note in the above diagram is that the system is not just what is in the brain. The environment is an integral part of it. The assembler must insure that motor command signals fed to the effectors are not in conflict with each other. The pattern recognizer is, of course, none other than the tree of knowledge. The system is highly symmetric. Notice that the environment and the TOK are complements of each other. In this light, behavior is seen to involve not just what an intelligent agent does to the environment, but also what the environment does to the agent. If you think about it for as long as I have, it will eventually dawn on you that the intelligence of an organism really resides in the environment.

Sensorimotor Pathways

The question that immediately comes to mind is, how does the TOK generate motor signals? The answer is that every time a low level node detects a sequential pattern, a signal is emitted. This signal can serve as a motor command that can be sent directly to an effector.
But why are only the low level nodes allowed to generate motor signals? Why can't the higher level nodes also generate them? The main reason has to do with the need for fast actions in response to environmental stimuli. Survival demands quick reactions which, in turn, depend on having very short sensorimotor pathways. The tree of knowledge is not a signal processor in the normal sense of the word. That is to say, signals do not come in at one end (the lower level), go through various processing layers and finally come out at the other end (top level). That would be way too slow.
Note: Over the years, various AI researchers, especially starting with Rodney Brooks in the 1980s, have warmed up to the idea that motor actions should be tightly coupled with sensory signals, i.e., with the environment. You can read about Brooks' subsumption architecture if you are interested in a radically different take on AI. As an aside, you may notice that a branch in the TOK is loosely analogous to a layer in Brooks' subsumption system, with the main difference being that the subsumption architecture does not have a tree of knowledge.
The TOK is an event classification/recognition/attention/prediction mechanism. Its primary purpose is to organize knowledge in a temporal hierarchy of related nodes. Within the context of motor behavior, it serves as a selector or switched conduit for signals arriving from the sensory layers. Sensorimotor behavior thus involves no computation. Essentially, there is a direct link between sensed events and the actions that they generate. I realize that this is somewhat counterintuitive. I expand on this topic in the motor coordination paragraph below.

Action Selection

One of the more obvious observations we can make about behavior is that it is highly selective. That is to say, we do not react to everything we sense all at once. The main reason is that, given the limited number of available effectors, trying to perform more than one task at a time would quickly generate all sorts of motor conflicts. So there is a need for a mechanism that limits the number of tasks the brain can do at a time. One of the nice things about the tree of knowledge is that it organizes events into neat packages called branches and allows only one branch to be active at a time. Since only the active branch can emit motor command signals, this effectively eliminates a huge number of potential conflicts. Furthermore, it restricts the generation of motor commands to temporally related events. So the TOK is itself the primary action selection mechanism. But there is more to it than that.

We all know from introspection that we do not automatically react to events all the time. Most of the times, we refrain from reacting. For example, we do not close the window every time we notice that it's open. Sometimes, we refrain from doing anything other than just observing. So obviously, the function of the action selection mechanism is to decide on not just what action to take but also on whether or not to take any action at all. This is a very important aspect of intelligence, one that is related to other topics such as adaptation, survival and conditioning. I will get back to this subject in a future article.

The Amazingly Simple Secret Behind Motor Learning and Coordination: Faith

Motor learning is amazingly simple. It consists of randomly connecting the low-level nodes from a branch of the tree of knowledge to various effectors and wait to see if they generate motor conflicts (see the previous post for more on motor conflicts). Connections that cause conflicts are strongly weakened and almost immediately severed. Eventually, only harmonious connections survive and the system automatically generates coordinated behavior such as walking, navigating and manipulating objects. I know, it all seems like magic. How does it work? I mean, how can there be intelligent behavior if there is no computation? The reason that this is possible is that the driving factor behind intelligence is not really in the brain but in the environment. In other words, pretty much all the computations that are necessary to generate intelligent behavior are performed by the environment, not the brain. By the time the sensors pick it all up, it has already been properly and thoroughly computed. As I have written previously in this series, intelligence is all in the timing of events. In this light, the brain is no more than a big organized switchboard, one which has faith that the environment will do the right thing and do it consistently even if the information captured by the senses is not always perfect.

Brave New World

I've decided to keep a couple of important aspects of my understanding of intelligence close to my chest for the time being. As I wrote elsewhere, I need to consider a way to use this knowledge to generate funds for my research. Regardless of what I do, there is no doubt in my mind that we live in interesting times and that the age of truly intelligent machines is just around the corner. It is much closer than even the most optimistic members of the artificial intelligence community (e.g., people like Ray Kurzweil and the folks at the Singularity Institute) suspect. Needless to say, it will profoundly transform the world in ways that we can't even begin to fathom. It has the potential for both good and bad. We can only hope that it will all turn out for the betterment of humanity. Stay tuned.

See Also:

The Deep Question: A Talk With Rodney Brooks

Tuesday, April 12, 2011

Should I or Shouldn't I?

The Need for Funds

I need money to continue my research in artificial intelligence and fundamental physics. I've had a plan to establish a Rebel Science Research Institute and hire engineers and teachers to work on various research and educational projects. But that takes money, lots of it. At this point, I am thinking that the best way for me to raise the funds that I need would be to use what I've already discovered in my AI research to develop a marketable product. Probably the most useful AI product is an intelligent robot that does all your work for you. However, designing and building a smart and reliable robot is a hugely expensive undertaking. So this is out of the question, at least for the time being.

Chess and GO

I figure that there is a small but significant market for a chess program that can be trained to play progressively better games. There is an even greater market for a powerful computer GO program. GO is an extremely popular board game, especially in Asian countries such as China, Japan and Korea. However, the best computer GO programs are somewhat disappointing because they can only play at a beginner's level. Any GO program that can play a reasonably good game (advanced amateur level or better) would be a huge success. GO is the sort of game that cries for an AI solution because the search space is so huge that using brute force to search through it is a waste of time, even for a super computer. I reason that I could start with an intelligent chess program for the mobile app market (Apple, Android, etc.) and use the profits to finance the development of a GO program. Subsequent profits would go into forming the Rebel Science Research Institute.

Quandary

I find myself in a sort of a quandary. Should I continue with my series on Intelligent Computer Chess or should I keep my understanding a secret for the time being and use it to develop a commercial product? You may not think so but I've already revealed a lot of crucial information about how the brain works, stuff that you will not find anywhere else. And my next post in the series will be even more revealing, as it will come close to letting the whole cat out of the bag, so to speak. Should I or shouldn't I? I need a little time to think about a proper course of action. Stay tuned.

Monday, April 4, 2011

Intelligent Computer Chess, Part VIII

Part I, II, III, IV, V, VI, VII, VIII, IX

Abstract

I apologize for taking so long to post this new installment. In Part VII, I explained how the memory builder builds permanent seven-node sequences in memory. Every sequence can itself be a node in a higher level sequence in the tree of knowledge. In this post, I explain the difference between short and long-term memory and the mechanism of motor behavior in Animal.

Memory as Recording Medium

Memory is a neural medium for recording signal sequences. Unless there is a pre-built neural structure that is ready to record a specific sequence of events, it cannot be recorded.
A five-node sequence
This is the reason that a written word (e.g., apple), shown to someone who cannot read English, will not be remembered as a word. The reason is that the high-level neural structures that are needed to recognize and record the word have not yet been constructed. Thus the memory system must anticipate potential event sequences and build the corresponding neural structures, otherwise there can be no learning and no remembering. It can do this by forming as many possible sequences as it can at every level of the memory hierarchy. Obviously, this can quickly become prohibitive, as the number of possible sequences is astronomical. There has to be a way of restricting the number of potential sequences in memory without the system running the risk of missing something important. This is a major problem, one that explains, in my opinion, why animals are not as intelligent as humans. I'll get back to this topic in a future article.

Short-Term Memory vs. Long-Term Memory

Short-term memory (aka attention or working memory) is whatever branch of the tree of knowledge is currently active. It is called short term because, unless it is reinforced by new sensory inputs, the branch can only remain active for a short period, about twelve seconds in the human brain.

The active branch has an initially high attention strength that slowly diminishes. Eventually its strength weakens to the point where the branch is deactivated and is replaced by another branch. However, an active branch can be preempted by another branch even before it has run its course. The reason for this has to do with survival. For example, you don't want your brain fixated on the little kitty on your lap while a lion is roaming nearby. The roar or the sight of the lion should wake up an appropriate branch in your tree of knowledge and put the kitty branch to sleep, otherwise you run the risk of being killed and that would be a bummer.

Effectors

Having a robot with the ability to remember things is great but unless it can use this ability to interact with its environment, it's not going to do it much good. Sooner or later, we must ask ourselves, how do we use the tree of knowledge to move our muscles? Although the solution may turn out to be easy, this is not an easy question to answer. First of all, before we can even think of a proper way to generate motor signals, we need to understand how the motor system works. I found out over the years that complementarity (the use of opposites) is the key to solving every hard problem in intelligence research.

On the one hand, we have positive and negative sensors that detect the onset or offset of sensed (input) phenomena; and on the other, we have positive and negative effectors that trigger (or effect) the beginning and end of motor (output) phenomena. An effector is a special neuron that controls an actuator (e.g., a muscle or a valve). An actuator has two modes; it can be either activated (started) or deactivated (stopped). A positive effector starts an actuator while a negative effector stops it. For example, in Animal, there are separate effectors that commands the Eye to move to the left, right, up and down. Other effectors move the gripper in various directions and still others cause it to grab or release a chess piece.

Complementarity and Motor Coordination

An actuator must have at least two control effectors, a starter and a stopper. However, since actuators are limited in number, they must be shared by different parts of the intelligent system. As a result, an actuator may receive command signals from an indefinite number of effectors. The problem is that we run the risk of having conflicting motor signals if the system attempts to accomplish different tasks at the same time. We obviously do not want different parts of the brain to try to use the same set of effectors at the same time. It turns out that complementarity is the key to properly design a well-coordinated motor system. The rules of motor coordination are:
  1. An actuator must not receive more than one command signal at a time.
  2. An actuator must not receive a start command if it is already activated.
  3. An actuator must not receive a stop command if is already deactivated.
These amazingly simple rules are the basis of intelligent motor behavior and motor learning in the brain.
Note: Let me take this opportunity to remind my readers that I developed my understanding of the brain's memory and motor systems almost entirely from my interpretation of certain symbolic (occult) passages in the Bible, especially the metaphorical letters to the seven churches of Asia in the book of Revelation and Zechariah's vision of the seven-lamp golden lampstand, the branch and the two olive trees. Again, if you have a problem with my Biblical research or if you believe that I'm some kind of nut, then my blog is not for you. I write only for kindred spirits, sorry.
Coming Up: Connecting the Tree of Knowledge to the Motor System

Now that we know what the motor system expects from us, we have enough understanding to figure out a way to use the tree of knowledge to generate intelligent motor behavior. I will cover this topic in Part IX.