   Which input to use for a neural network ? (ALife)
  Hi everyone,I've been reading some interesting stuff about A-Life recently, and came to the conclusion that simple neural networks may, after some genetic training phase, produce nice behaviors for an artificial environment with natural animals (herbivores, predators...).I was wondering, though, what would be the most efficient set of "sensor" neurons for the agents in such an environment.Most of the papers I've read seem to organize the inputs in directional slices relative to the agent position and orientation, e.g. number of carnivores on its left, number of herbivores on its left, number of plants on its left... then a similar set of sensors for a front- and right-arc.Would it be totally silly to consider having instead one set of sensors per perceived entity, with one of those sensors telling us on which side this entity is currently ?I believe this could help in keeping track of the behavior of a particular opponent (or friend), in the (maybe naive ?) hypothesis that the subsequent NN is capable of time-related computation. Because with the traditional approach of sensors, I have the feeling that agents are unable to tell from one frame to the next if the entities perceived just moved from one arc to the other, or if they moved away and been replaced by a different entity.Has such approach (entity-based instead of direction-based clusters of sensors) ever been investigated ? I'm unable to find any paper relative to this question, and I though some of you guys may help me with some hints about this.Thanks !   
  Is there an ultimate goal other than proving that you can do it with NNs? If there is, doing A-Life with NNs may not be the best choice.   ;Quote:Original post by InnocuousFoxIs there an ultimate goal other than proving that you can do it with NNs? If there is, doing A-Life with NNs may not be the best choice.Well, the ultimate goal is to provide a game environment populated with animals behaving interestingly (read, realistically, or at least not worthlessly)... I'm not really trying to prove anything about how this goal is reached.I was under the impression, though, that genetic training was the way to go (I don't want to code a set of rules by hand, for example... mostly because I think this approach would fail). And as I see things now, NNs fit well with automatic training (some numerical weights to tweak), when rule-based systems or state automata are far more difficult to auto-generate.Maybe one of these assumptions is wrong, though, or there is another way I haven't thought about ?   ;  If you are simply trying to populate a game world with "interesting characters", you can do that with very simple hand-coded rules rather than going through the trouble of designing and training a NN or by using a GA.   ;Quote:Original post by InnocuousFoxIf you are simply trying to populate a game world with "interesting characters", you can do that with very simple hand-coded rules rather than going through the trouble of designing and training a NN or by using a GA.Given your credits, I'm inclined to believe you ^^I also believe hand coded rules are widely used in commercial games.As I am so stubborn, though, please allow me to ask this question :Isn't this approach doomed to run into the pitfall of trying to code "Strong AI" (well, strong enough for animals, at least) with an expert system ?;Quote:Original post by TiPiouAs I am so stubborn, though, please allow me to ask this question :Isn't this approach doomed to run into the pitfall of trying to code "Strong AI" (well, strong enough for animals, at least) with an expert system ?There are a couple of premises here that need to be addressed. First, are you indeed trying to code "strong AI" as defined? To quote:Quote:Strong AI is artificial intelligence that matches or exceeds human intelligence — the intelligence of a machine that can successfully perform any intellectual task that a human being can.[1] It is a primary goal of artificial intelligence research and an important topic for science fiction writers and futurists. Strong AI is also referred to as "artificial general intelligence"[2] or as the ability to perform "general intelligent action".[3] Science fiction associates strong AI with such human traits as consciousness, sentience, sapience and self-awareness.The above goal would tend to conflict with the notion of what you declared you are trying to accomplish. It would seem that since you are only looking to achieve the appearance of stylized sentience, you don't need to achieve "strong AI". This, of course, is the goal for most games and certainly for the rudimentary animal behavior that you are describing.Second, like most people, you seem enamored with the idea of NNs. I would like to point out to you that the end result of a NN is a giant weighted sum. If you think about it, you have a long string of coefficient-weighted values that all get glued back together to give you a value. The same can be done with other methods such as the expert systems that you cite as well as a variety of utility-based models. These all take inputs from the world, weigh them by a variety of factors, typically multiply them with weighting coefficients, combine them in some manner, and achieve a final output. The difference is that you aren't waiting for providence to drop some mysterious answer into your lap. Instead, you are getting inside the head of your creation and asking questions such as:How would I act if I were a predator?How would I act if I were prey?What world information is important to me?What outcome is important to me?How important?Is consideration A more or less important than consideration B?etc...To be honest, constructing a NN is a lazy way of crafting a game agent. By using that approach, you are admitting that you have no idea why a creature you are trying to emulate acts the way it does... only that there is some mysterious way that it should act.Think about it this way... you could use a NN to train a traffic signal using the number of accidents and the gridlock as fitness functions. Or you could simply seek to explain what it is you are trying to accomplish and code those rules. The same could be said for coding more complex scenarios.The only time a NN is advantageous is in pattern-matching problems where there is no direct relationship between a collection of inputs and the desired output. Think of handwriting character recognition software, for example. There is no direct relationship between any one pixel and the character written. However, taken as a whole, you can actually train an OCR system to be fairly accurate. On the other hand, I could make the case that I can define a direct relationship between any input in your game world to the corresponding behavior of your predators and prey. The relationships (if the input is relevant) are generally fairly obvious and easily defined in context of the desired behavior. The issue at hand is one of focus. Rather than burning calories thinking of how many hoops of death you will need to jump through to design your (sub-optimal) NN, you only need to think about the actual behavior and codify that.   ;Quote:Original post by TiPiouIsn't this approach doomed to run into the pitfall of trying to code "Strong AI" with an expert system?What makes you think a NN is anything else but a similar "expert" system?  You give it a bunch of rules or examples, and it finds a slightly different way to represent them to try to generalize.  It's still a very narrow AI!   ;  @InnocuousFox : You make sense throughout you reply (thanks for so much detail) and I'm hearing you. I'll most likely think about this twice and, also likely, will ultimately put NNs aside as you suggest.However, for the sake of the argument, I would love to push the questions with you a little further. And I did in the reply I was about to post... until I re-read my own writings and realized it could sound like I was on the offensive again (which I'm not, it's just my usual way of confronting and assimilating the ideas of other people).So tell me if this exercise would be ok with you, now that you're warned :DOne safe comment though :Quote:Original post by InnocuousFoxThere are a couple of premises here that need to be addressed. First, are you indeed trying to code "strong AI" as defined?I'm not trying to "match or excess human intelligence" of course, but the second part of the quote : "the ability to perform general intelligent action" is definitely some part of the desired result. Well, I could be mistaken, but when I read "general", I see "in any environment, unknown settings included".@alexjc : Hearing you too ;) a reply to this would seem very similar to some points of the "argument" I was talking about ;) Same warning then ^^Regards,TiPiou.;  You're fighting an uphill battle to convince us here, but go ahead with your argument :-)   ;Quote:Original post by alexjcYou're fighting an uphill battle to convince us here, but go ahead with your argument :-)See, that's the kind of misunderstanding I get most of the time ^^ I won't fight to convince you of anything (well technically this *could* happen, but it's unlikely since you are the experts here when I'm only the newbie)... I'll just try and play the devil's advocate in order to try your points and hopefully understand them better ;)Quote:Original post by alexjcWhat makes you think a NN is anything else but a similar "expert" system? You give it a bunch of rules or examples, and it finds a slightly different way to represent them to try to generalize. It's still a very narrow AI!I understand that whatever the model, this is ultimately a set of rules, and that a NN "giant weighted sum", as InnocuosFox wrote, is similar to any other computation model.However, from what I understand about first AI attempts a few decades ago (hand-coded set of rules), first AI expectations ("match or excess human intelligence") and first AI result (inability to come close to even sub-sapient intelligence), what they felt into was :trap 1) a set of rules is hardly maintainable by hand when the number of rules skyrockets (which it does if the system tries to represent anything complex, such as a natural environment).trap 2) a set of rules will hardly be able to address any unknown input. Real brains not very well either, one could say, but at least the result is not "unable to comply".trap 3) one could not realistically express a set of rules trying to mimic the mind, when human knowledge about the mind is so limited.Then on the other hand, once again from my own understanding, Neural Networks, albeit similar to any computational model, don't necessarily fall into those traps, because :anti-trap 1) The rules are NOT maintained by hand.anti-trap 2) A NNs tries to match a pattern. If some input is totally unknown, it still tries to match it with something known and close to it. The result may not be awesome, but there's at least some half-clever result.anti-trap 3) same as 1). The NN is mostly seen as a black box.InnocuousFox : If you don't mind that I quote you out of context :"like most people, you seem enamored with the idea of NNs." - I am indeed ;)"constructing a NN is a lazy way of crafting a game agent." - It certainly is, and I am definitely lazy ! (I'm a programmer after all ;))"By using that approach, you are admitting that you have no idea why a creature you are trying to emulate acts the way it does..." - Yes I AM admitting it :)It sounds like you're judging as "bad" all this, but I'm claiming those points ;)Last one in particular, because of what I answered to alexjc above. Bad AI is a quite often heard complaint about most games, and I'm sure many of them tried a "by-hand" approach. Why would I do better than those pro with the same approach ?Granted, my setting { some animals with the appearance of natural behavior } may be far more tiny that what AI pioneers tried and failed. But is it *that* tiny ?In regard to your example with traffic lights (which I liked, btw), it seems to me that a traffic system with agents conforming to the driving code is some kind of (a) finite and (b) quite narrow system, as compared to any natural environment populated with animals.Would it then be idiot to think that an expert system could work for a traffic-light "AI", because trap 1) is avoided by (b) and trap 2) is avoided by (a), whereas in my setting, this won't necessarily be the case ?I am usually quite open with the idea of understanding things and micro-controlling the rules, as you advised me to do (getting inside the head of my creation and asking questions [...])However, for once I listened to the misfortune of people before me. A whole bunch of people told us "don't try a general AI with an expert system". And a few people told us "Hey I had not so bad result with NNs in A-Life... even some cases of nice emergent behavior !". Of course I am "enamored with the idea of NNs" ! ;)Now you two tell me that my setting is not general enough to care about those warnings... well I do believe you, but then I wouldn't mind a better understanding of the pros and cons ;)Again, please envision this post as a mean to understand you better, and not as a duel to the death with you ;)Many thanks ![Edited by - TiPiou on April 22, 2010 8:34:35 AM]