It surprises me as I search the literature that there is so little research into Neural Networks that mimic nature, that mimic our brains. They just aren't fashionable I guess, who was it that made comments in the early days that had that effect? Marvin Minsky? Perhaps that is the reason. Then again perhaps I am looking in the wrong place!
Originally there were all those network that were nothing like a real brain, perceptrons, recurrent networks, Hopfield networks, all carefully organised, understood and solving one function, or making one decision. All these networks seem to be fully connected and perform in a logical way.
The animal brain, on the other hand is totally weird rather than logical, its not likely to be fully connected (though in truth we don't know) and it can do more than one thing. And it certainly seems to me that the mind, consciousness, thoughts, desires, the ability to recognise objects, people, danger, are an emergent property of the brain rather than things that can be found by logic and vivisection.
I have heard so many people say that we can't simulate a brain on a computer because brains are analogue not digital, (which isn't entirely true, but its not entirely true of computers either). These of course are the engineers and computer scientists. On the other hand if you talk to biologists then the problem is that computers are silicon based and not protoplasm based.
This whole thing is a bottom up approach. Attempting to solve fine details when there is a whole mountain to tackle.
Of course the real problem is that people are daunted by the mountain, so they put up the only obstacle that they are not daunted by, some detail.
It seems to me that aiming for a network that we can understand is on of the problems that is holding us back. Emergent properties can not be easily analysed, I mean we can't even define what intelligence is.
Although the working model for most of society seems to be, "whatever a computer can't do"!
The animal brain is the result of evolution, and given that we have a well established artificial evolutionary paradigm it seems to me natural to try and use artificial evolution to evolve artificial neural networks that we don't understand, and which produce *emergent behaviour* rather than compute a well defined function.
Well I think that is my rant over, back to searching the literature, and doing the programming. With any luck if I don't find much in the literature that is relevant to my topic it will be less to write up!
13 May 2008
Neural Networks in Research: A top down approach.
02 May 2008
The Joys of Reading Other People's Code
I thought that it would make sense to read the code for NEAT and for Aria, but it turned out that it was probably not a good idea. The aim was that I would get a feel for what the code does and then I would have a change to write what I need. I didn't get that feel!
What I found was code where there is not enough comments to understand what is going on. Perhaps for the author there may have been enough, and he certainly would understand his own abbreviations (I assume) but there certainly was not enough for me.
OK, I think I probably put more comments than nearly all programmers, so probably I am biased any way. I think both internal and external documentation is very important, I try to use explicit names, although it is extremely unlikely that I will spell them correctly (most APIs don't include a spell checker!), which I am sure annoys lots of people!
Another problem was the indenting. To start with indentation was 2 spaces, which I find doesn't have the visual effect that I need. Secondly half of the indentation was all over the place, now I am assuming that this was the effect of importing the code into Visual Studio.
The next problem was the use of whitespace. In some places such as between identifiers and operators there was no whitespace, making whole lines of code one visually into word, not easily broken up by the eye. In other places there were loads of blank lines between every line of code. Sometimes there were even multiple blank lines between say a brace and the things outside the brace, so that it was not easy to see the connection that the braces made. As I write this I wonder if there were two coders with opposite styles involved, but that wouldn't really make sense. Perhaps importing affected whitespace as well as indenting.
I ended up spending days trying to sort out indenting, whitespace and matching braces, and didn't get much of a feel for the content at all. In frustration I changed indenting to a more Java style that a C++ style, which was probably, but now all the blank lines that are left are essential for comprehension, and probably some of those have gone too.
Finally the other thing that added to the obscurity of the code is the fact that functions, even after removal of blank lines, are often more that 200 lines long. My brain is simply not big enough to follow 200 lines of code in one lump. Clearly I am not a hacker! If a function goes much over one screen full its too much for me.
The length of the methods means that I am not at all sure that my attempt to find matching braces was correct. Does this close the if statement that started 20 lines ago, the switch statement that started 50 lines ago, the else that started 80 lines ago, the for loop that started 100 lines ago, or was it something before that???? Frankly all too often I gave up.
I don't have time to understand what this code does. I hope that I manage to find what I need to use, and don't miss anything too useful. If I use this code in the future I will definitely need to rewrite it.
Now when it comes to the ARIA code, well actually it wasn't much better. So at this stage, I don't know much, and I haven't achieved much!
I think I'll go and eat worms.
(Sorry that is a joke from the old country, I'm Australian now, but it just fits!)
20 April 2008
NEAT Documentation
How simple some things sound.
As mentioned before, I have a Windows version is NEAT, which I have converted to visual studio 2008. however it doesn't come with any documentation, to speak of. There is however a sentence which directs the user to the documentation, in Linux version of the NEAT code.
Downloading the code is easy enough, but of course it comes in a Gzip package, so first I needed a Linux computer to unzip the package. Not a problem, I recently bought a ASUS EeePC. I unziped the package and transferred it to full sized Vista laptop. (In case you don't know the EeePC is a sub-notebook with a 7" screen. And it has no C compiler.
It turns out that the documentation is in a Postscript file. A wonderful format for most of the world, but of course on Windows you have to pay someone Mega$$ to read it! And of course my printer is not a postscript printer.
Next, try reading the file on the sub-notebook. The file is 17 pages, and too wide to display at a legible font size on the 7" EeePC screen without scrolling sideways to read each line ... hardly conducive to digesting 17 pages of technical info! Setting up printing to a network printer on a Windows network is beyond me, and once again I failed. (One of these days I will set up a Linux network server, and solve the issue of different OSs).
How do I turn a post script file into something I can read on Windows? Google is your friend! It isn't long before I find a utility that can print a postcript file on Vista. Wonderful.
Download.
Install.
Run.
Error Message. " You are trying to print a Postscript file to a non-postscript printer".
Well YES!!@*!
Back to google. I found a wonderful site that will convert a Postscript file into a Portable Document File (PDF), just upload it and download the result. It took a few attempts, probably because I didn't read the instructions!
Finally I print the documentation. Success.
Next of course I need to understand it. But this has taken the whole evening, and I am too tired now. I should go to bed ... what is on TV?
18 April 2008
Microsoft Robotics Studio
Microsoft's robotic studio may well be another way of Microsoft trying to gain a monopoly, it would seem churlish not to at least check it out. In any case, people ask about, so could be good idea to be informed.
Microsoft visual studio includes a simulated P3-DX, so it seems, at first appearance, that it might actually be useful tool of this project. However running the simulator is not very intuitive.
When starting Pioneer 3DX stimulation, a 3-D scene appears reminiscent VRML type display, The simulated robot has bumpers and 16 sensors, so it would have to be changed to match our robots. When the simulation starts, the type window appears showing the loading of the robot. There is also the scene that had mentioned, and the dashboard, which can be used to control the robot. Using the dashboard is not intuitive.
These are the steps that need to be performed to use the dashboard:
1. Enter the computer name, the localhost is supposed to work, but doesn't seem to.
2. Enter the port number, which is one more than the port number shown in the console type window mentioned earlier.
3. Press the connect button. If this is successful, there will be two lines of text, looking like rather obscure directories, and appears in a large box below.
4. Next, you must double-click the line that contains the word motors, to turn the motors on. Left of that box there is a label indicating whether the motors on off.
5. Once the motors are on you can press the button labelled Drive.
6. Now you may use the 'sphere' above the stop button to drive the robot. (If you happen to have a joystick you can use that, but I have never owned one.)
You can turn the laser on and see a representation of the computers laser vision at the bottom of the dashbord. The dashboard is shown in the picture above. Here is a picture of the simulated environment, showing the obstacles that the laser vision is picking up. Unfortunately the Uni only has one laser range finder to share between the five robots, so I am planning to do this project without lasers.
Also you can change the camera view to robot eye view. Apart from that, the basic simulation is not very interesting. If the robots are one of this her a call or cylindrical obstacles they roll off to infinity, as if there is no friction in this environment.
I have yet to determine whether this is going to be a useful simulation environment or not. If I do use this tool, it will beat to work on Vision Systems, so the physics won't be particularly important.
17 April 2008
Visual Studio Gymnastics
Well it turns out that visual studio 2003 doesn't work on Vista, and is not going to be supported. It just wouldn't work and in the end I had to uninstall it, you forget how many hours it took to install.
Obviously I scanned have used a 2008 after all, is searching on the Web founder couple ways that might get it to work. Next stage was that she trying to use visual studio which is slightly less than intuitive. OK I could write a "Hello World" program, though in the existing projects turned out to be problematic. But after few days everything was hunky-dory.
For one thing when opening the project from an earlier version, don't try opening visual studio first, and then browsing to the project files from within the program it won't open them. On the other hand, opening of projects files from the Windows directory causes visual studio to convert it to the current version.
Another problem I had was something that was a registered bug in visual studio 2008, after spending the day trying to find a solution to that,, I went looking for another solution. I eventually found the Visual Studio 2005 Express Version download page hidden away on Microsoft's Web site.
Using 2005 learned more lot more about conversion programmes from other versions of Visual Studio, and about the aria operating system in particular. It looked like I'd found the solution.
The next step was to convert the neat program to visual studio 2005. Once again ran into problems, NEAT had numerous compilation errors in 2005, and not just undeclared variables. I converted the NEAT code to Visual Studio 2008, and I was able to compile at once I'd fixed at the undeclared variables. I returned to trying to convert the Aria code to 2008 and eventually had success.
Having eventually compile the code the next step was to get it to run on robots. After a number of attempts, we found a utility that allows 2008 code to run on the robots. In fact we were able to run both the 2005 and the 2008 code.
Success at last!
Next, actually writing my own code, the body of my project.
15 March 2008
Programming Robots and Compatibility Issues
My aim yesterday was to workout how to create a program in C++. load it onto the robot and run it. It should have been easy, I thought that I had set my goals too low, but it was what I was up to.
I am using a Visa laptop, this enables me to take my computer to the Uni where the robots are kept. It is also the newest computer that I have being approximately a year old, and should therefore be best placed to run the software that I need. I would have liked to have done this under Linux rather than windows, but I don't have a Linux box running at the moment, and don't have time. And a Linux laptop .... well that's for the future.
I had previously installed Visual Studio C++ 2008 Express Version, this being freely available on the Net. I had also installed the Aria source code etc., as well as NEAT source code. The Aria code was original written with Studio 2003 so needed converting to the 2008 version. I had spent some time getting at least a little familiar with the package. It was hard to find a starting point, and was heavy going, so I hadn't got as far as I would have liked! This is normal though for me trying to come to terms with someone else's code. I didn't get as far as compiling anything new.
Once I arrived at the Uni, Michael showed me how to set up an ad hoc network on the laptop they have there, and get a remote login to the robots. We were able to control the robot from the laptop easily. The aria software runs well, and is easy to use.
Next I wanted to know how to load a program that I had written and run it on the robot. This is where the problems started.
Fist working out how to use Studio 2008 was a bit of a problem. It would have been good if I had had enough foresight to do that before arriving at Uni. With Michael's patient assistance we worked out how to compile one of the examples. We loaded it onto the computer but it wouldn't run. We tried compiling a release version rather than a debug version. We tried copying all the DLLs into the same directory but it didn't help.
Eventually we decided that working with Studio 2003 which was used to create Aria in the first place may be the way to go. After spending an hour and a half loading the older version of Visual Studio it was approaching 7pm and with a 2 hour drive ahead of me I came home.
The next step was to install the service pack, but after 3 failed attempts I gave up. The program failed to start. Michael sent me some links showing that Microsoft is not supporting Studio 2003 on Vista.
I am currently uninstalling C++ 2003.
Its back to getting 2008 to work on the robot.
09 March 2008
Neural Networks
Artificial Neural Networks are an attempt to mimic the human brain, they are usually used in an attempt to create a program that can do some of the thing that people do effortlessly. But most Neural Nets are fully connected networks of similar neurones, very regular in structure and fully explained by the programmer.
On the other hand the natural network connections found in any brain is much more random, multi-layered, containing different types of neurones and largely beyond our comprehension. I would like to investigate a method of creating a neural network that is closer to the structure of the human brain.
Stanley and Miikkulainen (2002) have presented a method of evolving both Network Architecture and Initial weights in a process they call Neuro Evolution of Augmenting Topologies (NEAT). Network Architecture (or Topology) is arrangement of neurones and their interconnections. This process has produced some interesting results.
NEAT starts with a small simple network, and over successive generation it develops a more complex and involved structure. The networks that develop are very unlike traditional artificial neural networks and more like those of nature.
The researchers have made various versions of NEAT code available under GPL, and given their success and the limitations of this project this seemed like a really good place to start development.
Stanley, K. O., and Miikkulainen, R. (2002). Evolving Neural Networks through Augmenting Topologies. In Evolutionary Computing. 10(2), pp 99-127.
06 March 2008
Software
The P3-DX robots come with some software packages which I will describe below. There are other packages for an additional cost, but of course the aim of this research is to develop my own software. One of the most important aspects of this software is that it works on both Windows and Linux.
ARIA stands for Advanced Robotics Interface Application and is the API for the robots. It provides Object Orientated Classes to control peripherals, poll sensors and avoid obstacles. Now I need my network to evolve its own obstacle avoidance, but the built in version may useful in the first generations of the controller.
This is the diagram from their website showing what I believe are the components of ARIA.
ARIA is written in C++ and can be either single or multi threaded, quite useful for a neural network.
Another very useful feature, which you can see at the bottom of the diagram. It can either control a robot, which it does through a serial connection, or it can control a simulator, which it does through TCP/IP. This will enable me to evolve earlier generations of the controller on the simulator, then run a certain number of individuals on the hardware, which makes this project achievable.
MobileSim is the simulator. When it is running there we see the robot roaming within an environment which is created using Mapper Basic. Here you see the robot roaming around a building made of several rooms with various furniture. The area covered by laser sensors in shown in blue.
There is also Mobile Eyes which I have yet to get working, so I am not sure of its use or whether it would help or hinder in this project. (Perhaps I will have to read the manual). The website indicates it is a GUI, and a destination can be selected with the mouse, then user can watch the robot plot paths.
The other software that I will be using is some NEAT software. NEAT stands for NeuroEvolution of Augmenting Topologies. NEAT comes from a completely different source to the robots, so I will discuss it in the next post.
26 February 2008
Introduction, and the Robots.
This Blog will document and project devoted to the evolving annual network controller for Pioneer P3DX robot bases produced by mobile robots.
The robot bases and come up to about the mid thigh, and they have a flat top to place additional equipment on. A computer to will be placed on here to control the robot will also be equipped with WebCams. Here you see one with something that looked more like coffee maker to speakers and WebCam on top.
The robots have two main wheels so they can turn on the spot making them very manoeuvrable. There are eight sonar senses at the front so that it can 'see' what's in front of it. These and a WebCam will be the inputs that the robot has to use to learn to get around and find objects.
The robot bases are designed to be programmed in C++, but there also are both Java and Phython wrappers to interact with the drivers. It make sense at this stage program in C++. There is also some useful software for running simulations, which will be useful in selecting the most of the individuals from each generation.