: AI Libraries
Creating versatile libraries is hard because each problem can be completely
different from the previous.
Lots of path finding and search libraries exist because they are a little bit
easier to gener
Not a lot of AI learning libraries exist, and the ones that do are open source.
These libraries are often incomplete or very basic. Hard to generalize the
Some examples: A* Tactical Path finding for multi
unit strategy, PathLib for
dividual and group path finding, FANN (Fast artificial neural network),
FFLL (free fuzzy logic library)
Open source, written in c++
Patrick Bergen created these libraries to learn AI techniques. He states
exactly what he did and didn’t
do, what are the problems, and the experience
he went through. He also gives all the resources he used to help him create
the libraries. Very informational.
Finite State Machines
Semantic Networks, Unification
Maes Behavior Network
Belief, Desire, Intention: dMARS
, and some others.
Decided to only talk about one, Genetic Algorithms.
What was implemented?
Three classes and an interface. The interface (CGeneticGenome) should be
implemented by a custom class describing the problem space. It contains all
domain specific code of some problem. The first class, CGeneticModel,
represents the genetic algorithm. It
may be customized in a few ways, and
excuted. This model uses a single population, of the class CGeneticPopulation,
which is populated at initialization time. After that, the individuals of the
population, the genomes, are changed and moved only, but not d
and created. This should make a lot of difference in execution time.
The model is able to handle both fixed length and variable length genomes
As the model evolves, the genomes lengths can change.
The interface makes it possible to use any repres
entation you want for the
problem at hand. The interface serves as an interface (indeed) between the
application and the algorithm.
Parent selection types (used to select parents from the previous generation
to serve as parents for the next generation): Se
lection by rank, Roulette
Wheel, and Tournament.
Crossover types: fixed length one point, fixed length two points, fixed length
multiple, variable length one point.
Mutation types: change a gene, swap two genes.
This implementation is generic, b
ut very limited.
The possibilities of extending and modifying a genetic algorithm are large. I
made a consideration between studying long on this subject to gain deeper
insight in its intricacies, and moving on to other subjects and I chose the
cause its more important to me now to gain a wide understanding of
available AI techniques.
I do believe that my architecture may be extended without to much hardship.
Algorithms can be addictive. The drug is to make more and more
adjustments to the algor
ithm to make it find the solution in the fastest
possible way. The problem for me was not to lose the generality of the
architecture, in order to optimize the test problem I choose (the n
I found that testing is very important here, since
the algorithm can almost
always find a solution sooner or later, even though you completely fucked up
some of the code.
At one time I removed a bug and noticed that the algorithm become slower.
That was really annoying.
Since the algorithm is tweakable in
so many ways, it itself is a candidate for
optimization through a Genetic Algorithm.
A machine learning library written in c++
How it works
Idea and API
Torch is a machine
Written in C++
Aims to provide the best algorithms
In development forever
based methods, including multi
layered perceptrons, radial
basis functions, and mixtures of experts.
Many small "modules" (Linear module, Tanh module, SoftMax module, ...)
can be plugged together.
Vector Machine, for classification and regression.
Several Distribution package and classes for speech recognition with
Ensemble models such as Bagging and Adaboost.
parametric models such as K
neighbors, Parzen Regre
and Parzen Density Estimator.
There are only four important concepts in Torch. Each of them are
implemented in a generic class. And almost all classes of Torch are subclasses
of one of them.
DataSet: this class handles the data. Subclasses could be
for static or dynamic
data, for data that can fit in memory or on disk, etc…
Machine: a black
box that, given an (optional) input and some (optional)
parameters, returns an output. It could be for instance a neural network, or a
mixture of gaussians.
er: this class is able to train and test a given machine over a given
Measurer: when given to a trainer, it prints in different files the measures of
interest. It could be for example the classification error, or the mean
Google Portrait : Powered by Idaip Research institute
Bio Login: A Bi
Modal Face and Speech Login System