This is a very old project done at the uni available here for archive.
A simple neural network in OCaml, with an image encoder and decoder.
OCaml of course!
For byte code (slow):
$ make bc
For native code (much faster):
$ make nc
Clean up:
$ make clean
2 binaries are created: an encoder
in encoder/
and a decoder
in decoder/
The encoder takes a neural network configuration file, here located in encoder/mlp.conf
and an image in pgm format located in encoder/images
. Learning stops at 1000 iterations in the default mlp.conf
or if the error is small enough. Check encoder/mlp.conf
for more options.
$ ./encoder -f mlp.conf -d encoder.nn -o compressed_image.img images/lena.pgm
Decodes a compressed image with a neural network definition previousl saved by encoder.
$ ./decoder -d encoder.nn -i compressed_image.img -o output.pgm