Code Monkey home page Code Monkey logo

hyperbolic-nn-haiku's Introduction

Hyperbolic Neural Networks with dm-haiku

Hyperbolic embedding has proved to be powerful in numerous applications like graph embedding. The goal of this project is to make some of the current advances in Hyperbolic Neural Networks avaialable in JAX.

The neural networks are implemented with Haiku and the optimizers are based on Optax.

Installation

Make sure to install jax by following the official guide.

Install the project with pip:

pip install git+https://github.com/Raffaelbdl/hyperbolic-nn-haiku.git

Content

The following content is currently implemented.

Core

  • Manifolds
    • Manifold : interface to implement a Riemannian manifold.
    • Stereographic : implementation of the Stereographic manifold (generalization of the Poincaré manifold to handle positive curvature)
  • Activations : wrapper and most popular activation functions for Riemannian manifolds.

Layers

  • StereographicLinearLayer: base linear layer in K-stereographic model
  • StereographicVanillaRNN: base rnn layer in K-stereographic model
  • StereographicGRU: gru cell in K-stereographic model

Optimizers

  • rsgd: base riemannian stochastic gradient descent
  • riemannian_adagrad: riemannian version of the adagrad optimizer
  • riemannian_adam: riemannian version of the adam optimizer
  • riemannian_adamw : riemannian version of the adamw optimizer

Observation of the Stereographic manifold

Evolution of [-10, 10]² with the curvature

Translation in stereographic space of curvature -1

Scaling in stereographic space of curvature -1

Second before last embedding after training on MNIST dataset

For fully euclidian architecture :

For fully hyperbolic architecture :

For hybrid architecture :

hyperbolic-nn-haiku's People

Contributors

raffaelbdl avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

hyperbolic-nn-haiku's Issues

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.