Giter VIP home page Giter VIP logo

riemannian_latent_space's Introduction

Riemannian metric in latent space

Based on

Fast Approximate Geodesics for Deep Generative Models
Nutan Chen, Francesco Ferroni, Alexej Klushyn, Alexandros Paraschos, Justin Bayer, Patrick van der Smagt

Summary

VAEs and other latent variable models learn lower dimensional manifolds of the data. Often one takes the lower dimensional representation of the data to do some further analysis, e.g. clustering. However, if the learned manifold has curvature, Euclidean distance in latent space (i.e. straight lines) will not be a good measure of similarity for datapoints on the manifold. Instead one should calculate distances along the geodesics of the manifold, but this is quite computationally intensive. In the paper above, the authors propose calculating the geodesic distance approximately (but faster):

  • create a nearest neighbor graph in latent space, using euclidean distance. For short distances euclidean distance should still be an OK proxy for geodesics.
  • For each edge in the nearest neighbor graph, calculate the actual geodesic distance. This will correct for nearest neighbor pairs that are in a region of high curvature (i.e. they should actually be further apart then they are by euclidean distance)
  • Now, to approximate the geodesic distance between arbitrary points, we use shortest-path algorithms on the constructed graph (with edge distances being the riemannian distances).

TODO

  • toy example
  • Optimize the computations: calculating the riemannian distance (RiemannianMetric.riemannian_distance_along_line()) is pretty slow due to tensorflow's way of calculating gradients.

riemannian_latent_space's People

Contributors

redst4r avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.