Integrating Deep Learning with clojure.spec

clojure.spec allows you to write specifications for data and use them for validation. It also provides a generative aspect that allows for robust testing as well as an additional way to understand your data through manual inspection. The dual nature of validation and generation is a natural fit for deep learning models that consist of paired discriminator/generator models. TLDR: In this post we show that you can leverage the dual nature of clojure.spec’s validator/generator to incorporate a deep learning model’s classifier/generator. ...

October 11, 2019 · 5 min · Carin Meier

Focus On the Generator

In this first post of this series, we took a look at a simple autoencoder. It took and image and transformed it back to an image. Then, we focused in on the disciminator portion of the model, where we took an image and transformed it to a label. Now, we focus in on the generator portion of the model do the inverse operation: we transform a label to an image. In recap: ...

September 6, 2019 · 3 min · Carin Meier

Focus on the Discriminator

In the last post, we took a look at a simple autoencoder. The autoencoder is a deep learning model that takes in an image and, (through an encoder and decoder), works to produce the same image. In short: Autoencoder: image -> image For a discriminator, we are going to focus on only the first half on the autoencoder. Why only half? We want a different transformation. We are going to want to take an image as input and then do some discrimination of the image and classify what type of image it is. In our case, the model is going to input an image of a handwritten digit and attempt to decide which number it is. ...

August 30, 2019 · 4 min · Carin Meier

Simple Autoencoder

If you look long enough into the autoencoder, it looks back at you. The Autoencoder is a fun deep learning model to look into. Its goal is simple: given an input image, we would like to have the same output image. It’s sort of an identity function for deep learning models, but it is composed of two parts: an encoder and decoder, with the encoder translating the images to a latent space representation and the encoder translating that back to a regular images that we can view. ...

August 16, 2019 · 5 min · Carin Meier

Clojure MXNet April Update

Spring is bringing some beautiful new things to the Clojure MXNet. Here are some highlights for the month of April. Shipped We’ve merged 10 PRs over the last month. Many of them focus on core improvements to documentation and usability which is very important. The MXNet project is also preparing a new release 1.4.1, so keep on the lookout for that to hit in the near future. Clojure MXNet Made Simple Article Series Arthur Caillau added another post to his fantastic series - MXNet made simple: Pretrained Models for image classification - Inception and VGG ...

April 26, 2019 · 4 min · Carin Meier

Clojure MXNet March Update

I’m starting a monthly update for Clojure MXNet. The goal is to share the progress and exciting things that are happening in the project and our community. Here’s some highlights for the month of March. Shipped Under the shipped heading, the 1.4.0 release of MXNet has been released, along with the Clojure MXNet Jars. There have been improvements to the JVM memory management and an Image API addition. You can see the full list of changes here ...

March 22, 2019 · 2 min · Carin Meier

Object Detection with Clojure MXNet

Object detection just landed in MXNet thanks to the work of contributors Kedar Bellare and Nicolas Modrzyk. Kedar ported over the infer package to Clojure, making inference and prediction much easier for users and Nicolas integrated in his Origami OpenCV library into the the examples to make the visualizations happen. We’ll walk through the main steps to use the infer object detection which include creating the detector with a model and then loading the image and running the inference on it. ...

January 19, 2019 · 4 min · Carin Meier

How to GAN a Flan

It’s holiday time and that means parties and getting together with friends. Bringing a baked good or dessert to a gathering is a time honored tradition. But what if this year, you could take it to the next level? Everyone brings actual food. But with the help of Deep Learning, you can bring something completely different - you can bring the image of baked good! I’m not talking about just any old image that someone captured with a camera or created with a pen and paper. I’m talking about the computer itself creating. This image would be never before seen, totally unique, and crafted by the creative process of the machine. ...

December 18, 2018 · 6 min · Carin Meier

Clojure MXNet - The Module API

This is an introduction to the high level Clojure API for deep learning library MXNet. The module API provides an intermediate and high-level interface for performing computation with neural networks in MXNet. To follow along with this documentation, you can use this namespace to with the needed requires: (ns docs.module (:require [clojure.java.io :as io] [clojure.java.shell :refer [sh]] [org.apache.clojure-mxnet.eval-metric :as eval-metric] [org.apache.clojure-mxnet.io :as mx-io] [org.apache.clojure-mxnet.module :as m] [org.apache.clojure-mxnet.symbol :as sym] [org.apache.clojure-mxnet.ndarray :as ndarray])) Prepare the Data In this example, we are going to use the MNIST data set. If you have cloned the MXNet repo and cd contrib/clojure-package, we can run some helper scripts to download the data for us. ...

July 5, 2018 · 5 min · Carin Meier

Clojure MXNet Joins the Apache MXNet Project

I’m delighted to share the news that the Clojure package for MXNet has now joined the main Apache MXNet project. A big thank you to the efforts of everyone involved to make this possible. Having it as part of the main project is a great place for growth and collaboration that will benefit both MXNet and the Clojure community. Invitation to Join and Contribute The Clojure package has been brought in as a contrib clojure-package. It is still very new and will go through a period of feedback, stabilization, and improvement before it graduates out of contrib. ...

July 1, 2018 · 2 min · Carin Meier