Saturday, November 26, 2011

Neural network and work

The past week and leading up to thanksgiving has been a odd at work. They have decided to send me down to Colorado for some training as the software and my workload was sorta put on hold with preparing for this, they don't want me to start a project I can't finish before I leave, and some coworkers taking time off causing the things I could do to be a little less even though I'm at the tail end of most of the project I have. So this left me with a lot of time to think as I document and cleaned up the code and I decided to on break take up setting up some neural networks on my thumb drive.

I won't go too far into neural networks explanation as there are wikis for this. I have a bit of story on my interest in neural networks and other such research based programing though. In college I sat in on a Genetic Algorithm class for fun. I had an interest in it as I actually did some of my own exploration of it in middle or highschool after reading something in some magazine. I was using game maker way back then and doing some messing around in that that actually had some minor results, most of them being the agents evolving to find holes in my test area or simulation. Either way back at the class I was sitting in I learned a lot about them and learned the basic feed forward neural network. I had taken to making one and trying some things that hadn't been done before to my knowledge and have the neural networks learn to play tic tac toe by "learning" off each other.

This wasn't typical neural network training as I was just using the neural network to preform the work and because the concept of them seemed neat. The workhorse was a genetic algorithm picking and mutating wining agents every generation. This didn't quite work, there was something akin to subspecies in the code that more or less played rock paper scissors with each other. lets say there was 3 groups (that's what I sorta came to believe watching the games) group A would try and win diagonally, group B would try and win horizontally, and group C would try and wind vertically. The game was more or less decided on the first piece as each group had a very entrenched first move after an A agent would place it's move a B agent was basically give up and just fill in the board in a pattern that let A win, a group C would continue as normal and end up blocking the A agent while winning. similar relationship between group C and B. This let each group get enough representation in the genetic algorithms choice of fittest agents to have them represented in the next generation, which just leads to the same not really solving the problem and keeping the agents in equilibrium.

I haven't touched this problem in years but I was thinking about it on work, and decided to get some neural networks programed on break. Took a week with a lot of messing around but I got the agents to solve XOR and inverting the input which is my standard for a working neural network as I don't know too much about standards for these. I also made a "produce key" feature which allows a string to be made based on the weights and thresholds of the agent. This is actually very important to what I'm going for. While not completely versed in the genetic algorithm or neural network programing I've seen that it's kind of been leaning far to a naturalistic side of survival of the fittest. The fittest agent is taken and it has offspring that may be exactly the same or slightly different than it which does work but seems to be inefficient and leads to cycles of not solving anything as I've seen before with the tic tac toe test. So with this key I'm able to keep a "gene pool" and see if the offspring is  worthwhile of being put in the next generation in regards to solving the problem. I may be wrong on this but my learning years ago didn't go on about pruning the genepool and making sure every agent is unique. So right now I have a working neural network and a will to try and revisit an old experiment and possibly produce something of worthwhile research which is some fun I haven't had in programing in a while.

Thursday, November 17, 2011

Legacy and Lisp

I'm terrible at updating this but still feel I should, saddly it's a life one.

Works been going a bit slow so I've been asking the other guys on some project to do as "training/downtime" things. I almost regret it, I've herad about it being the back bone for some of the systems but I don't really want to learn it. It being Lisp.

I don't hate lisp, but I just don't like working with it. Python took quite a few things from it but one thing they didn't take was it's general syntax. I was annoyed with python indentation at the start but Lisp acts like the illegitimate offspring of C and assembly. Mostly for it's polish (not even reverse polish) approach to operate syntax. A quick example to show would be a while loop and it's set up.

(setq a 0)
(while (< a 20) (setq a (+ a 1))
  ;worthwhile stuff goes here!
  (print a)

That's a lot of parenthesis for something that counts from 0 to 19. I get it and easily see it becoming maddening balancing them. Thankfully I can farm out a lot of it by setting variables to be functions and going from there. At least it got me learning.

Wednesday, November 9, 2011

Boring daily life

Haven't updated as much due to lots of "fun" things going on that weren't fun at all. Though I figure  I'll post a brief amusing thing for today.

We just got hit by snow. From this morning to now we've gotten a good 3 inches possibly more and it's still coming down. Horribly wet sticky stuff that prevented me from hitting my daily place for food for lunch. Beyond that it managed to somehow kill the power on the grid at least 3 times. Lot of interesting things said when those power outages hit in a place that's suppose to have an uninterrupted power supply and everyone on a computer.

I may start gearing up for something soon, just been an odd past few weeks. I would like to get the python tutorials to "make your own fighter" stage which shouldn't be hard if I sit down for a few hours one of these days but it's been last on my list. You guys have probably been there before.