GithubHelp home page GithubHelp logo

gmm-gmr's Introduction

GMM-GMR

This repository contains the implementation of GMM-GMR based imitation learning from multiple trajectories. Python 2.7 is used for implementation so the code can be ROS compatible.

Installation

$ git clone & cd gmm_gmr
$ python setup.py install

Usage

from gmm_gmr.mixtures import GMM_GMR # Import the GMM_GMR class

... # Load your data and do stuff

gmm_gmr = GMM_GMR(trajectories, n_components)
gmm_gmr.fit()

t, generated_trajectory = gmm_gmr.generate_trajectory(interval)

GMM_GMR(trajectories, n_components)

  • trajectories: Trajectories used for training. If these are not aligned i.e list of trajectories, Dynamic Time Warping is used to align the trajectories. If you have aligned trajectories this should be np.ndarray with shape (N,T,D) where N is the number of trajectories, T is the time steps and D is the dimension. Note: If you are using end-effector poses, it is recommended that you convert Quaternions to Euler angles.
  • n_components: Number of principle components. This should be less than D.

GMM_GMR.fit()

This function trains PCA and GMM. Returns None.

Warning: The explained variance should be greater than 95% so you can generate nice looking trajectories.

GMM_GMR.generate_trajectory(interval)

This function applies GMR on the time steps that are generated from minimum time step to maximum time step with increases of interval. Then the trajectory is converted from latent space to the original space.

Returns a tuple (time, trajectory time is the time steps and trajectory is the generated trajectory.

Example Output

This is the output of example.py. Given trajectories are end-effector poses with respect to object frame. x axis is time steps and y axis is x,y,z coordinates.

alt text

gmm-gmr's People

Stargazers

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