Running Encog Neural Networks on the Rackspace Cloud
Future versions of Encog will support grid/cloud computing. The upcoming Encog 2.4 release will support limited cloud capabilities, for Encog to communicate status back to the "Encog Cloud". This will allow you to monitor training from anywhere, simply by logging into this web site. Encog 2.5 will add full "grid-based" training. You will be able to have more than one computer working on a problem.
Rackspace has a cloud, where you can "rent" computers by the hour. You can setup virtual images and pay a per hour cost based on how powerful of a computer you are using. I wanted to make sure that Encog works on the Rackspace cloud. Once grid computing is built in, you could actually rent several computers to help in the processing and then divide your task up amoung your computer, your computer's GPU, and even non-local grid "nodes", even using their GPU's if available.
The Rackspace cloud is located here:
http://www.rackspacecloud.com/
I logged into my account and deployed one of their most basic computers. It is around 1 cent an hour! Not very expensive at all. It comes with 256MB ram. I have a quadcore at my disposal, but its time is broken up with the other images that are also running.
Rackspace quickly sent me my login information and my new machine was ready to go.
IP: 173.203.106.157 root/Administrator password: encog-cloud7ffGF0Oo0
I've long since deleted this test server. So feel free to try the password if you like. ;)
The first thing that I did was perform an update, just to get everything up to date. This is done with this command.
yum update
Next, I installed Java.
yum install java-1.6.0-openjdk.x86_64
I downloaded the Encog examples, and used WinSCP to upload them to my new host. I probably could have used wget, as well. I then unzipped the examples.
unzip encog-examples-2.3.0.zip
I created a simple script, named benchmark.sh, to run the Encog benchmark example.
java -server -classpath ./lib/encog-examples-2.3.0.jar:./jar/encog-core-2.3.0.jar:./jar/hsqldb.jar:./jar/slf4j-api-1.5.6.jar:./jar/slf4j-jdk14-1.5.6.jar org.encog.examples.neural.benchmark.Benchmark
Note the -server option? Also do this! It causes Encog to run much faster. To execute the benchmark.sh file I must use chmod to give permission.
chmod +x ./benchmark.sh
I can now run the benchmark. On the weakest server type offered by Rackspace, this is the result I got.
0 of 7:Beginning benchmark 1 of 7:Training Elman result: 0.22 2 of 7:Evaluate 0 hidden layer result: 0.055 3 of 7:Evaluate 1 hidden layer result: 0.13 4 of 7:Evaluate 2 hidden layer result: 0.211 5 of 7:Train 0 hidden layer result: 0.056 6 of 7:Train 1 hidden layer result: 0.103 7 of 7:Train 2 hidden layer result: 0.146 Benchmark result: 0.921
Not bad at all. But I thought it would be interesting to try the most expensive server type. It is just under a dollar an hour. It has 16GB ram, and is supposed to give me the Lion's share of the CPU cycles. The results from the more expensive server are listed below.
0 of 7:Beginning benchmark 1 of 7:Training Elman result: 0.186 2 of 7:Evaluate 0 hidden layer result: 0.058 3 of 7:Evaluate 1 hidden layer result: 0.128 4 of 7:Evaluate 2 hidden layer result: 0.203 5 of 7:Train 0 hidden layer result: 0.047 6 of 7:Train 1 hidden layer result: 0.085 7 of 7:Train 2 hidden layer result: 0.132 Benchmark result: 0.839
Better by about 10%. A decent improvement, but I am not sure worth the extra cost. It MAY be more cost effective to rent multiple virtual computers and cluster them together. Especially if Rackspace is putting them on different physical machines. Further experimentation with this will be interesting when Encog supports grid training.



