elgertam / ANN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Artificial Neural Network

This is code I wrote for an Artificial Neural Network (ANN) when I was in college in 2009. The code is in Java and uses the Continuous Log-Sigmoid Function for activation. This is because (IIRC) that function is differentiable at all points, unlike other activation functions, such as a step. Differentiability is desirable for various reasons, but I can't actually remember them at this point.

Commentary

This code is fairly cringe-worthy, but I was a sophomore/junior in college when I wrote it. This was around the time I also wrote the infamous banner voting script in a few lines of Bash (http://www.breezejmu.org/sga-speaker-censured/article_f08710bf-483a-53cb-8edc-965b37c01ffe.html).

At the time, it was one of the most difficult programs I had written. Today I look back and realize that it wasn't that tough, and that I could have cleaned up the code significantly using better techniques. In particular, something resembling the "Subject-Observer" pattern would have been very useful in both feed-forward and back-propagation, and would have made the code simpler. As is, instances of the ThreeLayerANN class must manage all of the intricate details of feedforward, backpropagation and activation.

I had a pretty strong urge to go and clean up all of it when I first read it after so many years, but I decided to leave the code untouched. The files themselves still have the original file creation times when I stat them.

Anyway, I figured this might a fun thing to post on my GitHub page after several years. Enjoy!

About


Languages

Language:Java 100.0%