depth first search

“We can only see a short distance ahead, but we can see plenty there that needs to be done."

Tag: algorithm

Algorithm: RANSAC

RANSAC came up recently in a paper for a reading group I organize. I thought a Python implementation would make a nice addition to the algorithm bazaar that is gradually growing here at depth first search. Check it out! RANSAC stands for random sample consensus. The idea is that when you want to fit a [...]

A Reinforcement Learning Agent

I finally got around to putting up my code for a sarsa agent. A couple of things to note: The underlying function approximation is accomplished through a CMAC. Note that my CMAC implementation uses Python native hashing. In particular, if you know anything about CMAC, this is not memory bounded, as Python hashes are designed [...]

EM for Gaussian Mixtures

The next algorithm in my continuing series of short, hackable implementations of common machine learning algorithms is fitting a Gaussian mixture model through expectation maximization. This example follows section 9.2 in Bishop’s PRML. You can think of this kind of EM as “soft” clustering. We assume that the data has clusters, and that the cluster [...]

New Algorithm

It’s been awhile since I posted a new algorithm. I’ve been reading quite a bit on Monte Carlo methods, and in particular Markov Chains. I came across some pseudo code for what the authors of Monte Carlo Statistical Methods call a 2d slice sampler. Check it out! Now I suppose the primary difficulty in defining [...]