Giter VIP home page Giter VIP logo

equinox-siren's Introduction

Rise of the shadow dolphins

Sinusoidal representation networks (SIREN) can be used to parametrise any scalar or vector field $\mathbb{R}^n \to \mathbb{R}^m$, converge fast during training and are useful as physics-informed neural networks due to continuous differentiability. This repository contains a JAX implementation of SIREN using Equinox. Essentially, this means a multilayer perceptron (MLP) and special initialisation of weights & biases.

Getting started

Make sure you have installed JAX and Equinox. Copy src.py into your own project. Instances of SIREN can be created like

import jax
from src import SIREN

siren = SIREN(
    num_channels_in=2,                 # n (e.g. image grid)
    num_channels_out=3,                # m (e.g. RGB values)
    num_layers=4,
    num_latent_channels=1024,
    omega=30,                          # angular frequency
    rng_key=jax.random.PRNGKey(420)
)

Training SIREN

For an example on how to train the SIREN in Equinox, look at main.py. After installing Optax, scikit-image and tqdm, you can fit an image img.png via

python main.py --path_to_image img.png --num_epochs 1000

equinox-siren's People

Contributors

sukjulian avatar

Stargazers

Igor Kuszczak avatar

Watchers

 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.