Giter Club home page Giter Club logo

neural-physics-subspaces's Introduction

Data-Free Learning of Reduced-Order Kinematics (SIGGRAPH 2023)

Authors: Nicholas Sharp, Cristian Romero, Alec Jacobson, Etienne Vouga, Paul G. Kry, David I.W. Levin, Justin Solomon

a rendering of a ball rolling on a cloth, demonstrating a reduced subspace

[project page] [PDF] [video]

Use neural networks to fit low-dimensional subspaces for simulations, with no dataset needed—the method automatically explores the potential energy landscape.

This repo contains an implementation of our core procedure on some sample physical systems.

Installing

This repository is standard Python code, tested with Python 3.9 on Ubuntu 20.04, as well as OSX systems.

The most significant depenency is JAX, which can be installed according to instructions here: https://jax.readthedocs.io/en/latest/

Other dependencies are all available through pip and conda. Conda environment.yml file is included to help resolve dependencies.

This code runs on CPUs or GPUs, although generally the GPU will be dramatically faster.

Running

Basic

To run our systems and visualize them in a GUI, call

python src/main_run_system.py --system_name [system_name] --problem_name [problem_name]

where the available systems and problems are given below. This will run the system in the full configuration space. Click on UI elements in the upper-right to run the dynamics, etc. Note that the triangular tree nodes can be expanded to yield more options.

Fitting

To fit a subspace, call the following function. See the paper for parameters for the examples we showed.

python src/main_learn_subspace.py --system_name [system_name] --problem_name [problem_name] --subspace_dim=8 --weight_expand=1.0 --sigma_scale=1.0 --output_dir output/

which will iterative train and dump the resulting network files to output/

Running fitted models

Once the subspace has been fitted, it can be loaded in to the run script as

python src/main_run_system.py --system_name [system_name] --problem_name [problem_name] --subspace [subspace_file_prefix]

to explore the subspace. Note that [subspace_file_prefix] should not be a full filename, but the prefix which is printed by the training script.

Three quick notes about apparent performance:

  • JAX code is JIT-compiled, so all routines will have a lag when they are called for the first time.
  • JAX by default allocates nearly all available GPU memory at startup.
  • This vesion of our GUI is implemented in a way which may be slow on some machines. Be wary that rendering the scene data may actually be dominating the runtime, for incidental software reasons unrelated to our algorithm. Alternate GUIs can be used to circumvent the issue if needed.

Physical systems

The following systems are included:

  • "FEM" -- finite elemnet deformables in 2d and 3d
    • "bistable" -- 2d bistable bar
    • "load3d" -- 3d cantilevered bar
    • "heterobeam" -- 3d cantilevered bar with non-constant stiffness
  • "rigid3d" -- rigid bodies in 3d
    • "klann" -- Klann linkage
    • "stewart" -- Stewart mechansim

neural-physics-subspaces's People

Contributors

nmwsharp 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.