geek
The Hotness
Games|People|Company
Dominion - Stash Promo Card
Runewars
Dominion: Alchemy
Thunderstone
Dominion
Dungeon Lords
Alexander the Great
Agricola
Twilight Struggle
Murder at the Four Deuces
Stronghold
The Republic of Rome
Race for the Galaxy
Small World
Arkham Horror
Founding Fathers
Race for the Galaxy: The Brink of War
Through the Ages: A Story of Civilization
Vapor's Gambit
Battlestar Galactica
Chaos in the Old World
Le Havre
Last Night on Earth: The Zombie Game
Mystery Express
Puerto Rico
Endeavor
Power Grid
Vasco da Gama
Warhammer: Invasion
Descent: Journeys in the Dark
Space Hulk (3rd Edition)
Pandemic
Hansa Teutonica
Carson City
Campaign Manager 2008
War of the Ring
Livingstone
Cosmic Encounter
Stone Age
Le Havre: Le Grand Hameau
Tobago
Cosmic Encounter: Cosmic Incursion Expansion
Twilight Imperium 3rd Edition
Summoner Wars
War of the Ring Collector's Edition
Macao
Carcassonne
Dominion: Prosperity
Neuland
Steam
Rules | Subscriptions | Bookmarks | Search | Account | Moderators
Recommend
7
Brian Bankler
United States
San Antonio
Texas
flag msg tools
Avatar
patron06070809
mbmbmbmbmb
BoardGameGeek » Forums » Gaming Related » Computer Based Board Gaming
Whats the Best Java Neural Network toolkit?
Subject says it all. If you've hacked up a neural network to learn a game and used java I'd like to hear what toolkit (if any) you used, etc. I'm mainly looking for ease of use ... I haven't really played with NNs, but wanted to try. I've got a simple game done (I think the rules are right, but I'll have to test more) with random players, now it's time to start getting some (non-random) opponents!

So, which ones?
Chris Schenck
United States
Dayton
Ohio
flag msg tools
Avatar
patron070809
mbmbmbmbmb
Bah ... screw NNs.

Whip up some genetic algorithm AIs and evolve your computer players.
:D
Dave Nellis
United States
Denver
Colorado
flag msg tools
Avatar
patron0809
mbmbmbmbmb
I've played with this one to find over powered units in wargames.

http://www.cs.waikato.ac.nz/ml/weka/

Probably not exactly what you're looking for.

I'd be interested to hear what you learn.
Chris
United States
Bloomington
Indiana
flag msg tools
cbs42 wrote:
Bah ... screw NNs.

Whip up some genetic algorithm AIs and evolve your computer players.
:D


He still needs a NN (or other model) to evolve with the genetic algorithm.

I haven't done more than peak at any of the NN toolkits in Java, but I'm going to guess that a NN is not the way you want to go with for a game AI, unless it is a very simple game or you are very good and have a lot of hardware. Maybe an expert system with NN's at particularly interesting nodes. :)
Hide the cleavage. Ⓦ Ⓢhubert
United States
Portland
Oregon
flag msg tools
Avatar
050607080910
mbmbmbmbmb
obediah wrote:
I haven't done more than peak at any of the NN toolkits in Java, but I'm going to guess that a NN is not the way you want to go with for a game AI, unless it is a very simple game or you are very good and have a lot of hardware. Maybe an expert system with NN's at particularly interesting nodes. :)
NNs can be quite good at game AIs. Rummy and Backgammon have extremely strong NN players, for example. Blue Moon has a good one also (check the forums here). But you can't just drop in an NN and call it a day; you need to work out the proper inputs and outputs to have a hope of getting a strong player in the end, and there's a lot of tweaking and tuning that can be done after, of course.
Vladimir Atehortua
Colombia
Cali
flag msg tools
Avatar
mbmbmb
In the end, what a neural network will provide you is a "reflex output" for any particular input. The network must be trained, and the inputs and outputs are non-discrete (floating point) numbers. The value of a neural network is that in can be trained to provide a very accurate floating point output (accurate as in "getting exactly 3.25, not 3.24 nor 3.26") for a (trained) for scenarios where the input/output relationship is very hard to model (which means, you can't elaborate an equation, not even a high degree one, that models the expected out put and could thus be programmed in a more straight way).

To apply NNs for game AIs, you'd need to model a lot of the game characteristics as floating point values (for example, availability of the captain role, from 0.0 to 1.0 in puerto rico), which gets specially complicated if the system being modeled is not "perfect information". So much work to adjust the game concepts to the synaptic model of NNs, that it's kind of counter intuitive and feels like brute force to me.

I believe that computational problems that are not "open information", could be better solved via a genetic algorithm. There are frameworks with which you develop a java model of the system and then evolve it. check out:
https://watchmaker.dev.java.net/
It has a sudoku solver example (which for me qualifies as Sudoku AI)
All Glory To The Hypnotoad!
United States
Portland
Oregon
flag msg tools
Avatar
patron070809
mbmbmbmbmb
Well, if I remember correctly from my graduate AI & Machine Learning classes, about 90% of AI programming is developing a useful & appropriate data representation(see example at the end). This becomes even trickier when trying to use neural networks, and even trickier still when you try to evolve a network. Not something you're likely to accomplish with a plug-in NN app.

Depending on the game, you may have a far better & easier time using a min/max algorithm for a 2P game, or hand-coding strategies into a rule-based system. You need to understand at least the basic strategies, how the various actions affect later scoring, and so forth for the game at at least a medium level before you can even begin to develop an effective AI. If you can code Perl I think the CPAN archive has a games module that contains a plug-in minmax algorithm, as long as you have a way to produce a numerical score for how 'good' a position is - this is not always an easy problem either, & part of the reason Go AI is so intractable is the lack of a good way to rate a board position without doing in-depth analysis 20 or 30 turns deep.

Classic data representation issue: Think Roman numerals vs. decimal system. Try to a) divide MCMLXV by V b) divide 1965 by 5 See the issue? Or, c) represent Pi in Roman numerals. Try calculating the area of a circle of radius 18 - (XVIII *XVIII ) * XXII/VII - you'll get close, but not nearly as accurate or as easy as using decimal - 18*18*3.14149.
Last edited on 2009-05-04 17:30:40 CST (Total Number of Edits: 1)
BT Carpenter
United States
Reston
Virginia
flag msg tools
Avatar
patron070809
mbmbmb
subhan wrote:
Try to a) divide MCMLXV by V


M/V => CC
C/V => XX
M/V => CC
L/V => X
X/V => II
V/V => I

CCXXCCXIII

XXCC isn't valid, and needs to be translated. Move the last C to the front and split the other C to LL and encompass the XX:

XXC -> LXXX

CCCLXXXXIII
But wait! LXXXX isn't valid, so:

LXXXX -> XC
CCCXCIII (which equals 393, which is correct)

-or-

1965 / 5 = 363

There are some days I'm glad we weren't born with 4 fingers/thumbs on each hand.





All Glory To The Hypnotoad!
United States
Portland
Oregon
flag msg tools
Avatar
patron070809
mbmbmbmbmb
byronczimmer wrote:

There are some days I'm glad we weren't born with 4 fingers/thumbs on each hand.


Wouldn't be a problem, we'd just be using base 8 instead of base 10. There's not anything particularly special base 10 numbers, it's the 0 that works the magic. In many ways it would actually be easier & more intuitive because things would divide evenly (no remainder) by assorted powers of 2.
Brian Bankler
United States
San Antonio
Texas
flag msg tools
Avatar
patron06070809
mbmbmbmbmb
cbs42 wrote:
Bah ... screw NNs.

Whip up some genetic algorithm AIs and evolve your computer players.
:D


Actually, I was thinking about this (and talking with another programmer) who pointed that out to me, and I realized something ...

wmshub wrote:

But you can't just drop in an NN and call it a day; you need to work out the proper inputs and outputs to have a hope of getting a strong player in the end, and there's a lot of tweaking and tuning that can be done after, of course.


Given the game that I'm working on, I could use a correlation matrix. (Pretty much every decision can be modeled as an independant action). In fact, I could make a giant correlation matrix of weights (I'm thinking a 200 x 40, with perhaps a few 'extra' rows to tweak it). I'd only have 1-5 columns (of the forty) that are legal plays at a time, and most of the (200) inputs (corresponding to position) would also be zeroes. That may be too many genes (8000) to be manageable, but it would also be fairly easy to tweak, and I could (unlike a NN) eyeball a reasonable seeding value. More importantly, it seems to capture some (not all) of how I think when playing the game. ("I have this, so I need that."

When I was thinking of this via NN, I knew I'd need 40 outputs (for the choices) and at least 80 inputs. plus a few hidden levels. But it also has the tough problem of how to train intermediate decisions (things that may not score well now, but lead to long term positional growth). I'm definitely leaning towards a genetic solution now ... for one thing, it's easier to code.
Brett H
United States
Santa Clara
California
flag msg tools
Avatar
patron0708
mbmbmbmb
If you are going to use a genetic algorithm, you need to use something as the "gene".

The advantage of a genetic algorithm is that you don't need to train it, it will learn on it's own. The negative is it may not learn what you want it too. I developed a G.A. to play Blackjack and then iterated over 10,000 generations. The result? The best player would just stand on every hand regardless of what the dealer had.

The advantage of a Neural Net is that you can train it with half the data, and then test it with the other half to see if it is operating correctly. The disadvantage is that once it works, you have no idea how it works because the neural net becomes extremely complex. The other disadvantage is that it is difficult to "predict" what is the best structure for the neural net.

If you haven't read it, I suggest reading Blondie24. It explains the development cycle of using genetic algorithms to develop an A.I. to play checkers.

http://www.amazon.com/Blondie24-Playing-Kaufmann-Artificial-...
Phil
Germany
Bremen
Bremen
flag msg tools
mbmbmbmb
It is easier to find a problem solved by a NN than finding a NN that solves a problem.
Also applies for any other kind of artificial intelligence.
Front Page | Welcome | Contact | Privacy Policy | DMCA | Advertise | Support BGG | Feeds RSS
BoardGameGeek and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.