I've implemented a basic neural network module (in python) to control a simple agent. It's topology-independent, you can manually specify how neurons are linked to each other or instantiate a feedforward class.
But I'm still working on it.
If you want to exchange ideas, you can add me on ICQ (7795026) or google talk: cesar.gomes at gmail.com
I have to get a gmail setup. y=x/sqrt(1+x^2) is an approximation for a fast hyperbolic tangent +- .994 or try this inverse transfer similar to a radial basis function
a=x^4 y=a/sqrt(0.2^2+a^2)
I love plotting these darn things in three dimensions. I will get back to you later.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Python (and Fortran I might add) is one the easiest general purpose languages out there. It takes little effort to understand the code. You should have no problems at all.
Since my interest is in artificial life, my agent is a simple organism that perceives food (a sphere object in breve) within a radius and angle.
At every epoch breve updates my neighborhood and then the angle between my heading and the closest food is the input to my neural network (the input is normalized to [-1,+1] which corresponds to [-25, +25] degrees).
Scaling the normalized vector input looks like the logical way to proceed.
I have been using back propagation nets that adds an additional iteration to feedback the error signal to the input and hidden nodes in proportion to their sum. In a Feed Forward net how are hidden layers updated? Are your agents updating the weights only in the output layer?
There are so many directions to go. Experimenting with fast basis functions to create a range of neuron types 0.2^2 ..1.6^2 changes the response curve some nodes fire faster others are slower, to get two feed back parameters: accuracy or error on the weight and boltzman lattice field adjustment (0.2..1.4) in relation to their annealing rate is one direction worth considering. Lookup the Vavaldi algorithm for a fast annealing function based on the neighbors.This could save considerable computational processing. The spring cube is a complicated form of a Vavaldi Mass Spring System.
Are you a generating multiple nets and measuring their fitness to locate the food with the greatest accuracy. or using a different strategy? One last question have you used the graph functions in Breve or would you advise exporting the results?
I can send you a good deal of references or post them on my site.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Does your agent move to the food or have you created a form of locomotion (e.g. a walker of sorts)? Also how did you reinforce the presence of food as a learned pattern, or is it on automatic control e.g. if food : (self move to net-get-location). if it locates two food sources within the same distance, how does it choose?
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
general question, why do you think there exits so much reluctancy in industry to use FANN/BPANNs to solve basic problems. Neural Nets are one of the few systems that operate without complete knowledge, so why is there so much emphasis on discrete syntax based logic?
To code for example:
if a>b then
c=1
end if
c=0
In contrast a neural net with two inputs (a,b) and one output (c) would always generate a solution even when (a) doesn't exist. And when logic is faced with time it breaks down completely. What is there to do to stop the decades long trend of building systems of logic that have extreme difficulty with the representation of time, and create more errors? Despite our own ability to accept incomplete answers or generalizations.
You know these new CRM systems with voice recognition on the telephone, logic has one advantage. I once called a business and was first presented with press 1 for yes or 0 for no, as I moved through the system's menu options I was left with press 1 to leave a message or 2 to end this call. So knowing me I told the computer no I don't care to leave a message I was darn furious, and gave it an exception (pressing 0 e.g. no) and was able to get to a real person.
I don't know who's bright idea it was to build these 'sophisticated' CRM systems but they are darn annoying. Why people buy them maybe peer pressure. Honestly I would rather have the machine say your expected wait time is ten minutes and stay on hold, this guarantees I get thru to someone.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
At each time step the agent receives as input the angle between his heading to the closest food, then a neural network controls his locomotion: move forward and turn left/right by some degree.
Everytime an agent gathers food its energy level is incremented. I'm not telling how to gather food. A genetic algorithm is used to evolve the weights of the neural network (with a fixed topology). Organisms with higher energy levels are selected to reproduce. After a few generations they "learn" that the best way to survive is to gather as much as food as possible. It is much like an instinctive behavior.
This movie shows the best organism after 27 generations:
I contacted you on ICQ, your sim looks good, you could use this for a search engine. Could you extend the fitness score to energy/searchtime, if those dots were clients spread throughout a city or the web your agent could save a lot of time finding the best marketing strategy, Good Work.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
>> Could you extend the fitness score to energy/searchtime,
That's something I'll try to do next time. Defining a "path cost" and optimizing the search, i.e., always gather the closest food, is much like the traveling salesman problem, I think.
That was just a simple work I did to understand how Breve works.
Years ago I was a freelance designer and worked with two agencies. So I would market myself locally, call every service bureau in a seven mile radius, over 250 shops altogether. In addition to design and ad agencies plus another 100. I would then place a dot on a map of all the locations in my proximity; living in a big city.
Now I could walk 10-20 square blocks a day without looking like hell at the last stop. So I created a template with a circle cut out representing my search radius. Then circle the areas with the most dots, in five days I would hit every location with a portfolio, samples, and get a card or another lead. (That was just on foot) Did this for four years, wish I had a simulation that could optimize all the down range variables.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
I think this is a very cool example of how neural networks can be used for agent control in breve.
When you're done with the simulation, please consider submitting the code back as a demo or perhaps the neural network code as a class to replace the obsolete neural network code currently found in breve.
I've implemented a basic
I've implemented a basic neural network module (in python) to control a simple agent. It's topology-independent, you can manually specify how neurons are linked to each other or instantiate a feedforward class.
But I'm still working on it.
If you want to exchange ideas, you can add me on ICQ (7795026) or google talk: cesar.gomes at gmail.com
Python
What type of transfer function does it use?
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
I use the logistic function,
I use the logistic function, but it can be whatever you need.
That takes long
I have to get a gmail setup. y=x/sqrt(1+x^2) is an approximation for a fast hyperbolic tangent +- .994 or try this inverse transfer similar to a radial basis function
a=x^4 y=a/sqrt(0.2^2+a^2)
I love plotting these darn things in three dimensions. I will get back to you later.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Re: Agents
I will have to get back to you on how you interface your network with an agent. Not great with python yet, working of multi-segmented robots in breve.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Python (and Fortran I might
Python (and Fortran I might add) is one the easiest general purpose languages out there. It takes little effort to understand the code. You should have no problems at all.
Since my interest is in artificial life, my agent is a simple organism that perceives food (a sphere object in breve) within a radius and angle.
At every epoch breve updates my neighborhood and then the angle between my heading and the closest food is the input to my neural network (the input is normalized to [-1,+1] which corresponds to [-25, +25] degrees).
Cesar
FeedFoward?
Scaling the normalized vector input looks like the logical way to proceed.
I have been using back propagation nets that adds an additional iteration to feedback the error signal to the input and hidden nodes in proportion to their sum. In a Feed Forward net how are hidden layers updated? Are your agents updating the weights only in the output layer?
There are so many directions to go. Experimenting with fast basis functions to create a range of neuron types 0.2^2 ..1.6^2 changes the response curve some nodes fire faster others are slower, to get two feed back parameters: accuracy or error on the weight and boltzman lattice field adjustment (0.2..1.4) in relation to their annealing rate is one direction worth considering. Lookup the Vavaldi algorithm for a fast annealing function based on the neighbors.This could save considerable computational processing. The spring cube is a complicated form of a Vavaldi Mass Spring System.
Are you a generating multiple nets and measuring their fitness to locate the food with the greatest accuracy. or using a different strategy? One last question have you used the graph functions in Breve or would you advise exporting the results?
I can send you a good deal of references or post them on my site.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
AI Questions?
Hello Cesar,
Does your agent move to the food or have you created a form of locomotion (e.g. a walker of sorts)? Also how did you reinforce the presence of food as a learned pattern, or is it on automatic control e.g. if food : (self move to net-get-location). if it locates two food sources within the same distance, how does it choose?
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Incomplete Logic
Hello Cesar,
general question, why do you think there exits so much reluctancy in industry to use FANN/BPANNs to solve basic problems. Neural Nets are one of the few systems that operate without complete knowledge, so why is there so much emphasis on discrete syntax based logic?
To code for example:
if a>b then
c=1
end if
c=0
In contrast a neural net with two inputs (a,b) and one output (c) would always generate a solution even when (a) doesn't exist. And when logic is faced with time it breaks down completely. What is there to do to stop the decades long trend of building systems of logic that have extreme difficulty with the representation of time, and create more errors? Despite our own ability to accept incomplete answers or generalizations.
What's your opinion?
One Advantage
You know these new CRM systems with voice recognition on the telephone, logic has one advantage. I once called a business and was first presented with press 1 for yes or 0 for no, as I moved through the system's menu options I was left with press 1 to leave a message or 2 to end this call. So knowing me I told the computer no I don't care to leave a message I was darn furious, and gave it an exception (pressing 0 e.g. no) and was able to get to a real person.
I don't know who's bright idea it was to build these 'sophisticated' CRM systems but they are darn annoying. Why people buy them maybe peer pressure. Honestly I would rather have the machine say your expected wait time is ten minutes and stay on hold, this guarantees I get thru to someone.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Hi Firefly, At each time
Hi Firefly,
At each time step the agent receives as input the angle between his heading to the closest food, then a neural network controls his locomotion: move forward and turn left/right by some degree.
Everytime an agent gathers food its energy level is incremented. I'm not telling how to gather food. A genetic algorithm is used to evolve the weights of the neural network (with a fixed topology). Organisms with higher energy levels are selected to reproduce. After a few generations they "learn" that the best way to survive is to gather as much as food as possible. It is much like an instinctive behavior.
This movie shows the best organism after 27 generations:
www.ime.usp.br/~cesargm/exp2.avi
Cesar
Practical Application
I contacted you on ICQ, your sim looks good, you could use this for a search engine. Could you extend the fitness score to energy/searchtime, if those dots were clients spread throughout a city or the web your agent could save a lot of time finding the best marketing strategy, Good Work.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Got you on ICQ! >> Could you
Got you on ICQ!
>> Could you extend the fitness score to energy/searchtime,
That's something I'll try to do next time. Defining a "path cost" and optimizing the search, i.e., always gather the closest food, is much like the traveling salesman problem, I think.
That was just a simple work I did to understand how Breve works.
Marketing
Years ago I was a freelance designer and worked with two agencies. So I would market myself locally, call every service bureau in a seven mile radius, over 250 shops altogether. In addition to design and ad agencies plus another 100. I would then place a dot on a map of all the locations in my proximity; living in a big city.
Now I could walk 10-20 square blocks a day without looking like hell at the last stop. So I created a template with a circle cut out representing my search radius. Then circle the areas with the most dots, in five days I would hit every location with a portfolio, samples, and get a card or another lead. (That was just on foot) Did this for four years, wish I had a simulation that could optimize all the down range variables.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Code Exchange
I would love to see your neural net bot, I can send you the code for the red walker in the gallery.
I have not failed! I have only tried 100,000 ways that will not work. —Thomas Edison
Cool demo!
Cesar,
I think this is a very cool example of how neural networks can be used for agent control in breve.
When you're done with the simulation, please consider submitting the code back as a demo or perhaps the neural network code as a class to replace the obsolete neural network code currently found in breve.
- jon
Hi Jon, It would be very
Hi Jon,
It would be very nice to give a small contribution to the Breve development.
As soon as I finish the code I'll contact you.
Cesar