I moved the function into the examples/cluster/som_digits.py, and explained what's happening, and why it's useful in commit 367c44b