Sunday, December 31, 2006

Neural Networks Attempt in Haskell (Quite a Failure Though...)

I ported the python version of BPNN into Haskell. Gotta admit that the porting was really a piece of cake: writing the Haskell code is just liking copying a mathematics textbook! However, it did killed some of my brain cells to try to use maps and folds.

Finally I realized that the double loops in the python code was trying to do matrix and vector multiplication... and after several hours' work I fixed my program to work properly. Though the learning procedure seems to converge slower than the python version, due to some unknown reasons.

Well, now the program is killing my memory chips... and the hard disk for virtual memory's sake. It runs quite slow when I try to use it to predict the average GDP of China... perhaps it's actually too huge for it. However, I'll try it thru the night. Let's see tomorrow morning if it eventually gives out any results. It's consuming more than 70% of the mem, while only 0.7% of the CPU time. I don't give it too much hope though.

Just a try. And seems to be quite a failure. But Haskell seems really fun when used this way~~

1 comment:

Anonymous said...

最近,我碰到你的博客,并一直在阅读一起。我以为我会离开我的第一个评论。我不知道该说什么,只是我喜欢阅读。不错的博客。.