cl-fann released!!!!
You're probably not as excited about this as I am, but that's too be expected. You, in fact, probably don't even know what cl-fann is.
What is cl-fann?
cl-fann is a CFFI wrapper for libfann, a fast artificial neural network library. Currently, it implements all of the functionality in version 2.0 of libfann, which unfortunately isn't quite the latest version.
How do I get it?
You can grab it at github, under masonium/cl-fann. It requires alexandria, trivial-garbage, metabang-bind, and cffi, which are all quickload-able. (Oddly enough, cl-fann isn't yet available on quicklisp, but hopefully I'll get that fixed soon). It does use ASDF, though, so you just need to create a link in your ASDF registry to fann.asd and use (asdf:load-system :fann) to get everything going.
What can I do with it?
Well, as far as I can tell, anything you can do with libfann 2.0. You can load formatted datasets from file, train neural networks on them, and evaluate those neural networks on different inputs.
A couple of examples are included in the fann-examples package, defined in examples.lisp.
How do I use it?
The examples and docstrings are the main source of documentation for cl-fann, but libfann itself has great documentation that lends itself toward using cl-fann as well. A few pointers, though:
In general, any function in libfann has a corresponding function in cl-fann that just drops the fann_ function and uses hyphens as separators, rather than underscores. For instance,
fann_merge_train_datain libfann is justfann:merge-train-datain cl-fann. Similarly, the enums are replaced by keywords, soSIGMOID_SYMMETRICin libfann would be:sigmoid-symmetricin cl-fann.All of the
fann_create_*functions are merged together into a singlefann:create-neural-networkfunction, that combines all of the requisite functionality.Most of the
fann_get_*andfann_set_*accessors are setf-able functions. For instance,fann_get_learning_momentum( ann )is just(fann:learning-momentum ann)in cl-fann, andfann_set_learning_momentum( ann, 0.1 )translates to(setf (fann:learning-momentum ann) 0.1)
What's Missing
Right now cl-fann only supports the double-float version of libfann. I'm not entirely sure how I'll add single-float and fixed-point versions, but I will at some point (soon, hopefully).
I've only tested this in SBCL on Linux. It should work in any distribution that supports CFFI, as I'm fairly sure I don't do anything SBCL-specific. I have no idea if it works in Windows, but again, I don't know why it wouldn't.
A proper tutorial. More on that soon.
This sucks! Who do I complain to?
Please send any comment/questions/suggestions/complaints to masonium AT masonium DOT com.
11:30 PM | 0 CommentsTest Post
I always wanted to try Chyrp, and since it recently resurfaced, I decided to give it a try.
02:18 PM | 0 Comments