This repository contains an implementation of the sinkhorn algorithm (1) in TensorFlow so that it can differentiated through.
tf_wasserstein.pycontains the necessary tensorflow functions, notably the functionsinkhorn_lossthat computes the sinkhorn distanceswiss_roll_demo.ipynbcontains an example use of the sinkhorn_loss, implementing a sinkhorn autoencoder (2) on the swiss roll dataset
tf_wasserstein.pyrequires TensorFlow 1.1 or greater and all dependencies thereinswiss_roll_demo.ipynbuses TensorFlow 2 and matplotlib
- Cuturi, Marco. "Sinkhorn distances: Lightspeed computation of optimal transport." Advances in neural information processing systems. (2013). http://papers.nips.cc/paper/4927-sinkhorn-distances-lightspeed-computation-of-optimal-transport
- Patrini, Giorgio, et al. "Sinkhorn autoencoders." arXiv preprint arXiv:1810.01118 (2018). https://arxiv.org/abs/1810.01118