Code Monkey home page Code Monkey logo

choreo-graph's Introduction

Choreo-Graph: Learning graph representations of the dancing body

Mariel Pettee, Santiago Miret, Somdeb Majumdar, Marcel Nassar

This is a codebase for applying GNNs to choreography. Our model, based on Neural Relational Inference (https://arxiv.org/abs/1802.04687; https://github.com/ethanfetaya/NRI), is implemented in Pytorch Geometric. The model sorts the fully-connected directed edges of the input data into discrete learned categories of edge types based on similiarites in their interactions and uses this latent graph representation to predict the future dynamics of the system.

Dancers may find this work useful to their practice because of the model's ability to identify a small number of edge connections within the body that are important for predicting future dynamics. By isolating the top (or bottom) edges in each category, ranked by normalized log-probability, dancers can gain new insight into their most and least important cross-body connections. By comparing edges between categories, they can also learn some of the various interaction dynamics that characterize their motion.

Dependencies

  • torch == 1.4.0
  • torch-geometric == 1.6.1
  • numpy
  • tqdm
  • jupyter
  • matplotlib
  • ffmpeg (recommended for making animations)

Usage

Example training command to test your setup:

python train.py --name="test" --epochs=3 --batch_size=1 --batch_limit=1 --node_embedding_dim=36 --seq_len=10 --predicted_timesteps=2 --sparsity_prior

Calling the training script automatically loads the raw data contained in the numpy arrays saved in the data folder and converts it into graph structures for training. A new folder with the name you gave it ("test", in this case) will be created under the logs folder with dataloader objects (dataloader_*.pth) saved alongside the log file itself (log.txt) and your script's arguments (args.pkl).

For full trainings, --batch_limit should be 0, the default value, to allow the model to see every training sample.

Testing and edge type evaluation is implemented in the vae.ipynb notebook.

Animations

Predictions on a single test batch:

Predictions on a test set of 200 timesteps:

Edge type #0 (non-edge):

Edge type #1:

Edge type #2:

Edge type #3:

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.