/akkatrain

Simple online learning example using Akka

Primary LanguageScalaMIT LicenseMIT

Online Learning with Akka

This repository contains a simple collection of actors which we use to train a convolutional neural network using with images from the MNIST database. The system consists of three actors:

  • Producer is responsible for sending images to Consumer
  • Consumer trains a neural network after receiving messages
  • Coordinator is used to facilitate communcation between Consumer and Producer, and the outside world.

The classifier is a neural net, build via Deeplearning4j.

To build the application, run:

sbt assembly

This will produce target/scala-2.13/akkatrain.jar, which can be used like any other jar. To start a demo application, run:

java -cp target/scala-2.13/akkatrain.jar org.cmhh.Main

Note that dl4j is huge, so a fat jar will weigh in at well over 1GB. Modify build.sbt if you have dl4j already in your classpath. Also note that the dependencies are configured to use the CUDA back-end for dl4j, but the CPU back-end can be used instead (and is in project/dependencies.scala, but commented out).