Tuesday, December 25, 2007

AIMA JAVA v0.92 released

This release has a rewrite of the Neural Network code. The old code didn't do pre processing of data and so the networks would get saturated for some data sets. The new code normalizes the data sets and so doesn't have this problem.

The release also includes an implementation of Online DFS (Thanks Ciaran!). Carl Anderson, Senior Scientist at ArchimedesModel.com requested that heuristic functions return doubles instead of int. This is an excellent idea so that's done as well.

The next release scheduled for 28th Feb, will have code for planning (chapters 11 and 12 + bits of chapter 9) + whatever else we feel like working on!

Sunday, November 18, 2007

Implementation of Online DFS Agent (Fig. 4.20) available

Been a while, was home back in Ireland visiting family and friends and started a new job, so have had a little less time available to hack away at this stuff. The implementation for this algorithm can be found in:
with a test case available in:

Thursday, October 18, 2007

AIMA JAVA 0.91 released

Well, it was released on Oct 1, 2007 but I forgot to announce it here. This release adds all of Ciaran's work on the search algorithms plus the usual bug fixes.

The next release is scheduled for Nov 15, 2007.

Friday, September 7, 2007

Genetic-Algorithm implementation added

An implementation of the algorithm described in Figure 4.17 page 119 is now available. The NQueensDemo has been updated to include an example of calling this algorithm. Of interest is the number of iterations/time it takes, on average with respect to the size of the search space, compared to the other algorithms to converge on a goal.

Tuesday, August 28, 2007

Recursive-Best-First-Search available

Just finished an implementation of the Recursive-Best-First-Search from Figure 4.5 page 102 of AIMA. The implementation may be found in aima.search.informed.RecursiveBestFirstSearch along with an associated test case in aima.test.search.searches.RecursiveBestFirstSearchTest, which creates a test that mimics Figure 4.6 from page 103. This has also been added to the MapDemo. I think a Genetic Algorithm implementation is up next :-)

Thursday, August 23, 2007

Implementation of Bidirectional search available

After a week of crashed machines and painful recovery/upgrading efforts, I finally got around to implementing a version of the Bidrectional search described on page 79 of the text book. This can be found in aima.search.uninformed.BidirectionalSearch. A fairly comprehensive test driver for this can be found in aima.test.search.searches.BidirectionalSearchTest as the implementation turned out to be a little trickier/subtler than originally anticipated.

Sunday, August 19, 2007

Chp 3 Additions to Bleeding Edge Code

Added implementations for:

Fig 3.1, pg 61 Simple-Problem-Solving-Agent: aima.search.framework.SimpleProblemSolvingAgent
Fig 3.2, pg 63 Romania: aima.search.map.SimplifiedRoadMapOfPartOfRomania

In addition added an implementation of the
Uniform-cost search from page 75.

A demo of these can be seen in:
which uses all the existing uninformed search algorithms. Currently considering writing an implementation of the BidirectionalSearch as well in order to round out all the searches discussed in Chapter 3 - fun fun :-)

Sunday, August 12, 2007

Dr Ciaran O Reilly joins the Aima Java Project

Dr Ciaran (pronounced Keeraan) O' Reilly, a researcher in AI from the San Fransisco Bay Area, has joined the AIMA Java project.
Having another contributor to the code base is awesome! We are still working out the fiddly details like how to ensure the formatting conventions are shared etc, but Ciaran's code has been checked into the codebase and he has commit rights (though he is still having problems with the svn server at Google code).

Tuesday, July 10, 2007

Parsing changes for Version 1.0

After a small hiatus, I Started working on version 1.0. The focus will be on implementing the "logic arc" from chapters 8 thru 19. The propositional logic part has been done but first order logic and planning is very sparse.

One of the problems of working with logic in java is that one ends up writing custom parsers. I don't want to use parser generators (like jlex/cup), because that would increase the number of jars/libraries that users need to download. Thus the recursive descent parsers in aima java.

Coding the lexer and parser and associated visitors is very tedious and I was a little desperate to remove the tedium. One approach is to write an SExp parser that takes care of generic sexp parsing and another need specific parser that parses the resulting sexps into the required dtata structures. I've prototyped this and it does seem to work.

I am still stuck on visitors though. Most tree walking needs double despatch and "visitor" seems to be the only way to do this in Java. The code is f_ugly though.

Friday, June 15, 2007

Hosted on Google Project Hosting

Dr Norvig has moved the repositories of the Java and Python code to Google Project Hosting.

Version 0.9 of AIMA -Java is now official ,

Sunday, May 13, 2007

Saturday, May 12, 2007

[AIMA JAVA Pre Final] Implemented PassiveADPAgent And PassiveTDAgent

The Passive ADP Agent converges much faster than the PassiveTDAgent, which is as it should be.
The Alpha symbol was a bit confusing till I recognized it was the probability normalizing constant!(I mistook it for a learning constant like the ones in neural networks).

Now onto Q Learning!

Wednesday, May 9, 2007

Friday, May 4, 2007

[AIMA JAVA Pre Final] Implemented Value Iteration

The code is now generic enough to handle any M by N environment with x ( >= 0 ) blocked squares. The MDP is derived out of the world structure. A further refinement might be to implement some kind of text file reader so that folks could design new worlds. I'll wait and see if there is enough demand for something like this.

Sunday, April 29, 2007

AIMA JAVA Pre Final - Implemented CellWorld

checked into the google code repo.
Number of tests = 399.

Sunday, March 25, 2007

Friday, March 23, 2007

AIMA JAVA Pre Final - (HMM) Fixed Lag Smoothing Implemented

I've duplicated the algorithm in the text (fig 15.6 in my edition), but this (algorithm, as published) is almost certainly wrong. The forward operation uses the latest (the t-d th would have made more sense) perception. This doesn't make too much sense.
The values don't match up with those generated by the foreward backward implementation (which is almost certainly working correctly).

Need to get the algorithm clarified by Dr N. Incredibly enough, there aren't too many resources online about this particular (variant of the) algorithm .

Tuesday, March 13, 2007

AIMA JAVA Pre Final - (HMM) Forward Backward Implemented

nice snippet of code. very powerful algorithm

Monday, March 12, 2007

AIMA JAVA Pre Final - Present Status

Working on Chapter 15.

Implemented an HMM with predict, update and forward.
The code for this (after extensive refactoring) is looking good.

I used an example from Probabilistic Robotics as an additional requirement for the HMM code, i.e, enable the HMM implementation to model a robot with uncertain sensors and stochastic actions. This has worked out well, as an HMM modelling a robot has to make provision for robot actions.

The example in AIMA models a passive observer trying to estimate the probability of rain from seeing whether his superior carries an umbrella or not. Unlike the robot, he has no action he can take that modifies the environment.

The present implementation models both these situations as can be seen from the unit test.

I've also implemented the code for single step smoothing (section 15.2 page 545 in my edition).

AIMA JAVA Pre Final - The Plan

I expect to post the pre final version of the AIMA java code to Dr Norvig at the end of this april/beginning of May.

This release will contain the code for Chapters 15(Probabilistic Reasoning),16 (Simple Decisions), 17(Complex Decisions) and 21 (Reinforcement Learning). I also need to fill in a few gaps in the code list. Plus bug fixes.

If anyone is having problems with the game playing code, do get the latest code . For some reason, the code at the site doesn't match with the code base though this code was written well before the last release.

The next release (AIMA Java Final) will focus on implementing the code for the "logic arc" ie chapters 9,10,11,12 and 19. The code for prepositional logic is already in place and has been extensively field tested, but I am not very happy about the FOL code. This will probably get rewritten.