Skip to content

Instantly share code, notes, and snippets.

@reson91
reson91 / kmeans.py
Last active March 25, 2017 14:21 — forked from dave-andersen/kmeans.py
k-means in Tensorflow
import tensorflow as tf
import numpy as np
import time
class TFKmeans:
centroids = None
assignments = None
def __init__(self, cluster_num, max_iters=1000, attempts=5, tol=1e-7):