Skip to content

A multi-gpu implementation of the self-organizing map in TensorFlow

License

Notifications You must be signed in to change notification settings

alexander-gabriel/tensorflow-som

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorFlow Self-Organizing Map

An implementation of the Kohonen self-organizing map1 for TensorFlow 1.5 and Python 3.6. This was initially based off of Sachin Joglekar's code but has a few key modifications:

  • Uses TensorFlow broadcasting semantics instead of tf.pack and for loops.
  • Input data is expected from a Tensor rather than a tf.placeholder, allowing for use with faster and more complex input data pipelines.
  • Training uses the batch algorithm rather than the online one, providing a major speed boost if you have the GPU RAM. Also, as a result of that, I added...
  • Multi-GPU support (for single machines with multiple GPUs, it doesn't have multi-node training).
  • Some summary operations for Tensorboard visualization

example.py contains a simple example of its usage by training a SOM on a 3 cluster toy dataset. The resulting u-matrix should look something like this:

Example U-Matrix

I was going to write a blog post about this but I ended up just repeating everything I wrote in the comments, so please read them if you'd like to understand the code. For reference, the batch formula for SOMs is

SOM batch formula

where theta is the neighborhood function and x is the input vector.

1http://ieeexplore.ieee.org/document/58325/

About

A multi-gpu implementation of the self-organizing map in TensorFlow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%