Skip to content
/ ocamlnn Public

Simple image (ppm) encoder and decoder using a neural network in OCaml

License

Notifications You must be signed in to change notification settings

jfyuen/ocamlnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OCaml NN

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.

Prerequisites

OCaml of course!

Installation

For byte code (slow):

$ make bc

For native code (much faster):

$ make nc

Clean up:

$ make clean

Usage

2 binaries are created: an encoder in encoder/ and a decoder in decoder/

Encoder

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

Decoder

Decodes a compressed image with a neural network definition previousl saved by encoder.

$ ./decoder -d encoder.nn -i compressed_image.img -o output.pgm

About

Simple image (ppm) encoder and decoder using a neural network in OCaml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published