Chainer character embeddings

Continues from [Numpy character embeddings] (/Numpy-character-embeddings/). </p> The numpy embedding model turned out to be extremely slow because it wasn’t vectorised. Chainer is a python deep learning package that enables us to implement the model easily with automatic differentiation and the resulting vectorised operations are fast - and can be run on a GPU if you want. In this post I’ll explore how the different optimisers perform out of the box.

Read More

Numpy character embeddings

Continues from [Embedding derivative derivation] (/Embedding-derivative-derivation/). </p> Let’s implement the embedding model in numpy, train it on some characters, generate some text, and plot two of the components over time.

Read More

Embedding derivative derivation

Sometimes you can’t use automatic differentiation to train a model and then you have to do the derivation yourself. This derivation is for a simple two-layer model where the input layer is followed by an embedding layer which is followed by a fully connected softmax layer. It is based on some [old and new matrix algebra (and calculus) useful for statistics] (http://research.microsoft.com/en-us/um/people/minka/papers/matrix/).

Read More

Markov random fields and socionics

Socionics comes across as the more serious and academic eastern European cousin of MBTI (which is much better known by English speakers). Although many of the same criticism that apply to personality theories/tools such as MBTI are also applicable to socionics, I find these models fascinating. Here I’ll use socionics to set up a fun application/demonstration of Markov random fields.

Read More

Image segmentation with loopy belief propagation

The package pyugm is a package for learning (discrete at this stage) undirected graphical models in Python. It implements loopy belief propagation (LBP) on cluster graphs or Gibbs sampling for inference. In this post I’ll show how a simple image segmentation model can be build and calibrated.

Read More

Hidden conditional random fields

When we want to classify sequences, HCRFs are - if we can forget about recurrent neural networks for a moment - discriminative counterparts to hidden Markov models.

Read More

Spelling correction with pyhacrf - Part 2

Continues from [Spelling correction with pyhacrf] (/Spelling-correction-with-pyhacrf/). </p> In this post I’ll look in more detail at how [pyhacrf] (https://github.com/dirko/pyhacrf) can be used to generate spelling corrections for incorrect tokens. We’ll use cross-validation to set the regularisation parameter, add character transition features, and compare the model’s spelling suggestions to a Levenshtein baseline.

Read More

Spelling correction with pyhacrf

In this post I’ll describe how to generate suggestions for incorrectly spelled words using the [pyhacrf] (https://github.com/dirko/pyhacrf) package. pyhacrf implements the Hidden Alignment Conditional Random Field (HACRF) model in python with a sklearn-like interface.

Read More

Hello world!

First post! I plan to add some posts about the pyhacrf project soon, and later something on probablistic graphical models and relational learning with deep networks.

Read More