Ciphers with Vector Symbolic Architectures

A secret message inside a 10,000 hyperdimensional vector We’ve seen in previous posts how we can encode data structures using Vector Symbolic Architectures in Clojure. This is an exploration of how we can use this to develop a cipher to transmit a secret message between two parties. A Hyperdimensional Cipher Usually, we would develop a dictionary/ cleanup memory of randomly chosen hyperdimensional vectors to represent each symbol. We could do this, but then sharing the dictionary as our key to be able to decode messages would be big. Instead, we could share a single hyperdimensional vector and then use the protect/ rotation operator to create a dictionary of the alphabet and some numbers to order the letters. Think of this as the initial seed symbol and the rest being defined as n+1. ...

July 2, 2023 · 4 min · Carin Meier

Vector Symbolic Architectures in Clojure

generated with Stable Diffusion Before diving into the details of what Vector Symbolic Architectures are and what it means to implement Clojure data structures in them, I’d like to start with some of my motivation in this space. Small AI for More Personal Enjoyment Over the last few years, I’ve spent time learning, exploring, and contributing to open source deep learning. It continues to amaze me with its rapid movement and achievements at scale. However, the scale is really too big and too slow for me to enjoy it anymore. ...

December 31, 2022 · 9 min · Carin Meier

Breakfast with Zero-Shot NLP

What if I told you that you could pick up a library model and instantly classify text with arbitrary categories without any training or fine tuning? That is exactly what we are going to do with Hugging Face’s zero-shot learning model. We will also be using libpython-clj to do this exploration without leaving the comfort of our trusty Clojure REPL. What’s for breakfast? We’ll start off by taking some text from a recipe description and trying to decide if it’s for breakfast, lunch or dinner: ...

March 15, 2021 · 4 min · Carin Meier

Thoughts on AI Debate 2

AI Debate 2 from Montreal.AI I had the pleasure of watching the second AI debate from Montreal.AI last night. The first AI debate occurred last year between Yoshua Bengio and Gary Marcus entitled “The Best Way Forward for AI” in which Yoshua argued that Deep Learning could achieve General AI through its own paradigm, while Marcus argued that Deep Learning alone was not sufficient and needed a hybrid approach involving symbolics and inspiration from other disciplines. ...

December 24, 2020 · 4 min · Carin Meier

Clojure Interop with Python NLP Libraries

In this edition of the blog series of Clojure/Python interop with libpython-clj, we’ll be taking a look at two popular Python NLP libraries: NLTK and SpaCy. NLTK - Natural Language Toolkit I was taking requests for doing examples of python-clojure interop libraries on twitter the other day, and by far NLTK was the most requested library. After looking into it, I can see why. It’s the most popular natural language processing library in Python and you will see it everywhere there is text someone is touching. ...

January 24, 2020 · 8 min · Carin Meier

Parens for Pyplot

libpython-clj has opened the door for Clojure to directly interop with Python libraries. That means we can take just about any Python library and directly use it in our Clojure REPL. But what about matplotlib? Matplotlib.pyplot is a standard fixture in most tutorials and python data science code. How do we interop with a python graphics library? How do you interop? It turns out that matplotlib has a headless mode where we can export the graphics and then display it using any method that we would normally use to display a .png file. In my case, I made a quick macro for it using the shell open. I’m sure that someone out that could improve upon it, (and maybe even make it a cool utility lib), but it suits what I’m doing so far: ...

January 18, 2020 · 5 min · Carin Meier

Hugging Face GPT with Clojure

A new age in Clojure has dawned. We now have interop access to any python library with libpython-clj. Let me pause a minute to repeat. ** You can now interop with ANY python library. ** I know. It’s overwhelming. It took a bit for me to come to grips with it too. Let’s take an example of something that I’ve always wanted to do and have struggled with mightly finding a way to do it in Clojure: I want to use the latest cutting edge GPT2 code out there to generate text. ...

January 10, 2020 · 7 min · Carin Meier

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