Artificial Intelligence...

Status
Not open for further replies.

erikengh

Ars Tribunus Militum
2,280
Not that I am an expert on the area but isn't LISP a bit old fashion? I think Standard ML/NJ, Haskell and Prolog are better choices.

But it should be possible to use Java too. Depends on what you want to do. Or you could always include a Prolog interpreter inside your Java program.

AI is such a big area that it is difficult to recommend anything unless you have some idea of how you want your AI to be. I read a book called Machine Learning. Think that has a good general introduction to most AI techniques.

If you want a fancy AI system I suggest you try to make a neural network or a genetic algorithm (or derivaties).

Should probably be lots of sites on the web about neural networks and genetic algorithms.
 
I've had one course on the subject of "Applied AI" which is basically what you're talking about. It should be noted though that that AI is basically searching; that's what it often become in the end at least.

We used a pretty good book: "Artificial Intelligence: A modern approach" (It's a bit of a misnomer, as the one we had was pretty old, I think there's a new edition out now though.) It's quite good and describe many areas to suffiecent detail so you can sit down and implement stuff. There are also psuedo code to demostrate. (Without it any programming book is just bollox IMHO.)

We used Java to implement most things, it's quite nice. Searching, neural netowrks, genetic algorithms are all easy to do in Java. Some things like parsing and logic is quite hard though. (One assignment was to make a basic Prolog like interpreter; it was by far the hardest one.)

Lisp is still widely used in AI, I don't really know any besides the basics unfortunately. But if you get into it I'm sure that it's great for this kind of stuff. (But it's not a requirement.)

For a bunch of links it seems like the Google directory has quite a few on the topic. (I can't seem to find any in my bookmarks file. I need a datamining program to find stuff there nowadays. ;-)
 
A good place to start is on www.gamasutra.com they have a load of articles by game developers covering lots of topics (including A/I). The articles are really well written with formulas and explinations of them.
Some things to search for (on google of course) "A Star" "shortest path" "smart systems" "AI" "Heuristic".
You'll also want to touch up on your math and big-o knowledge, writing a AI algorithm is one thing but it's also got to be FAST and return a appropriate result (always) within a specified time alotment.
 

crazydee

Ars Tribunus Angusticlavius
8,772
Subscriptor
Have a look at Prolog. For a long time it was the default choice of the AI community, and even if you never use it again it will completely change your idea of what programming is.

It's a language with no separation between code and data which is designed for trawling searching spaces. It's particiularly different as you don't really explain how to solve problems (it has it's own way of doing that) but specified the problem domain and the result drops out.
 

Calvin

Ars Tribunus Angusticlavius
9,331
Subscriptor++
For all of my AI projects that haven't used language parsing, Java was fine. if I found java to be too slow, I recoded in C++.

Mind you I've done most of my work in Neural nets, but I also did some decision tree, kNearest Neighbor, and some dabbling in genetic algorithms.

Expert Systems also probably require a non-Java solution. ;)
 

orestis

Ars Tribunus Militum
1,598
I've done some online reading... AI is more complex than it sounds. I think I need to get my hands on a book about programming AI as I didn't found anything like it on the web. I think I got the principles though. Hey, speed isn't a concern. I just want to fool around. Genetic algorithms thrill me! Last night I was thinking in bed about how many things can be solved with them.
 

Tychom

Ars Tribunus Militum
2,391
Subscriptor
You may also want to take a look at game theory. Allthough a lot of work in this area focuses on economics (predicting markets etc) many principles and techniques are usefull in Computer Science and game playing machines (particularly in larger games such as chess - which are based more on research in game theory than they are in AI, developing games trees, evaluating the strength of positions etc).
Also take a look at cellular automata for simple rule based systems (a lot of research has taken place on automata by the game theory crows also - development of evolving systems and stuff).
 

rithm

Ars Scholae Palatinae
802
For starting out, you might want to use the classic text by Russell and Norvig. Ask at any tech. bookstore, they'll know it. For speech processing (semantic/lexical/syntactical emphasis) try:
Developing Natural language Interfaces
It's in C/C++, but the algorithms are sound. For Prolog, try:
Simply Logical
That book is killer, and an easy read, also. If you're interested in AI in Java, there are quite a large number of projects that you can download, muck about with and Learn While Doing. For connectionism/artificial neural networks you can use JOONE:
http://joone.sourceforge.net
which has pretty good documentation and a nice set of classes to get you started.
For building text recognizers/natural language processors and whatnot, I'd stick w/Java. I've switched everything to Java personally, and I've been doing AI programming for about... thirteen years.
Okay, I'm going to go home and lie down. Grampa's tired :) Seriously, I'm only 28 - but it feels older. Java's a good language for AI, though - a good general purpose language w/lots of support.
Failing that, go w/prolog. It's pretty damned nice.
Peace,
'Rithm
 

orestis

Ars Tribunus Militum
1,598
Wow, lots of replies. I've been in many sites about AI but I can't find what I'm looking for : A small step-by-step example for implementing something. AI can be mind-boggling in the beginning, and what I need is something simple. Most of the sites I've been have such an enormous (and ugly looking) content I'm scared out!

That AI for Arsians is a good one! Go for it!

I have a question to the experienced here:

Can someone build a genetic algorithm that finds not the optimal solution for a specific problem, but that can cross-breed new algorithms to find the optimal algorithm for a problem.
It goes without saying that this is hard but once done you can breed an algorithm for any problem you have. Now all I need is a way to represent algorithms in a way that they can be cross-bred and I'm on my way to the Nobel! ;)
 
The optimal solution to a problem is an algorithm. That's what genetic search does - it recombines sections of programs (algrorithms) looking for those that produce correct output and also rate high on some arbitrary merit scale in order to use them in future recombinations. Whence "genetic algorithms".

I think I know what you are really asking about - some "meta genetic algorithm search" that can automatically find optimal algorithms, independent of the problem domiain. But I am skeptical, because of the word "arbitrary" that appears above. What is the optimal algorithm? The fastest? The shortest? The one with the least extreme variations in run time ("most predictable")? Optimal just means that some constraint or other is minimized, but just what constraint depends on who you ask. You can't just tell a computer "find me the best algorithm" without specifying exactly what "best" means to you. That is, genetic searches are tied very closely to specific problem domains.
 

orestis

Ars Tribunus Militum
1,598
hmm... it's getting tricky.

What I think I mean is:

We have genetic algorithms that cross breed solutions to find the optimal one, right ? Like a genetic algorithm that finds the shortest path, for example. It generates random paths in the beginning, selects the shortest ones, cross-breeds them, spawns a new population, and repeats until a condition applies (a minimum distance is reached or the upgrades in the new paths are negligible).

Now we have the shortest path in a specific problem. This algorithm can work fine in every path-seeking problem by using the same sequence.

What if a way could be found to generate random path-seeking algorithms ? You do the genetic process just once end you end up with an algorithm (not a genetic one) that finds paths. Probably you will not be able to explain how the derived algorithm works, as it will be evolved through a series of random mutation and natural selection.

In a nutshell, can genetic algorithms be self-referential ?

I think that if a way could be found to represent algorithms in a way that they can be:

evaluated in run-time,
randomly mutated and
cross-bred

this could be done. The hard part is the representation, IMHO. Can someone please inform us if this has been done ?
 
OK, yes, in your example, you can apply genetic search to paths themselves. In this case the solution is just a path. This is a fairly pedestrian use of genetic search, I think. When I hear the term "genetic algorithms", I have always understood it to mean the application of genetic search to algorithms themselves. In which case the solution is an algorithm. This is what you are suggesting (I realize now), and yes, it has been a topic of research for at least a decade. I think it is also referred to as "genetic programming".

I am only familiar with his works in passing, but I believe John Koza at Stanford is one of the leading researchers in this field. You might search for his name on the web.

The best example I can remember reading about in any detail concerned genetically bred sorting networks for sorting arrays, with the constraint being the most succesful algorithm would require the fewest number of swaps.

Representation is a problem. I believe Koza and others use Lisp ("programs = data") for this purpose. But you can imagine, the type of problem and the constraint you want to minimize will affect the representation dramatically. Also, one part of judging fitness is simply determining that a candidate solution is even valid. In the case of, say, paths, it's easy enough to check that they are connected. But for an algorithm, you have to have some way to determine that it actually solves your problem before you can ask if it solves the problem better than some other candiate. That also requires knowing a good bit about the specific problem at hand. That's why, when I thought you were suggesting a "genetic algorithm for genetic algorithms" that would work independent of any specific problem, I was skeptical.

[This message was edited by BigRedDot on May 24, 2002 at 11:52.]
 

orestis

Ars Tribunus Militum
1,598
OK, now I think we're talking about the same thing. This field is HUGE ! No wonder it can be very easily misunderstood. Just thinking of what can be done makes my head creak ! Think about applying genetic programming (or what the researchers call it, anyway) to swarms ! You can begin with something very small, like a proto-bacterium and evolve it... You can get very strange and new computer-generated lifeforms. And then everything explodes in my head. I think I have a mission in my life now.

As for checking if an algorithm solves your problem, I think that unnatural selection fits very well. Make the solution to the problem essential for the, ah, living algorithm to survive and you're done. Algorithms that don't solve the problem die. I realize of course that this is damn hard to implement, especially in neuron networks, but it's a good idea nevertheless.

I think that I have to learn LISP ASAP because my head will explode if I don't make something fast. I'm bursting with creativity !

For anyone that comes here looking for resources, I've found a nice page that demonstrates swarms with Java applets. Source code available too.

You can find it here :http://www.aridolan.com/
 
Looking for a way to breed algorithms instead of solutions (ala GA)? Try genetic programming (GP). Its exactly what you want. And John Koza is the man to write the BIG THICK books on it.

And if you are looking for an example of how to do AI, you are going to have to be way more specific than that. AI is a huge field covering everything from, bayes nets, decision trees, fuzzy logic, GA, GP, reinforcement learning, A* search, natural language processing, nueral networks, game theory, and the list goes on and on. If you want to know how to do something, you are going to have to have some idea as to WHAT it is you want your AI to do. Not all AI will do all kinds of things.

gen
 
Status
Not open for further replies.