This package contains the inference implementation (Gibbs Sampler) for the "Physically Consistent Bayesian Non-Parametric Mixture Model" (PC-GMM) proposed in [1]. This approach is used to automatically (no model selection!) fit GMM on trajectory data while ensuring that the points clustered in each Gaussian represent/follow a linear dynamics model, in other words the points assigned to each Gaussian should be close in "position"-space and follow the same direction in "velocity"-space.
This package offers a nice way to cluster the robot trajectory data in 2D and 3D space based on their similarity measured by their velocities and locations.
A more user friendly interface will be developed soon.
To check the demonstrations, open the demo_loadData.py and check the following settings.
pkg_dir = r'E:\ds-opt-python\ds-opt-python\phys_gmm_python'
chosen_dataset = 12
sub_sample = 2 # '>2' for real 3D Datasets, '1' for 2D toy datasets
nb_trajectories = 7 # For real 3D data
pkg_dir
Change it to the package root.chosen_dataset
We now offer datasets from 2D to 3D. Numbers 6-10 represent 5 different demo 2D datasets and numbers 11 and 12 represent two 3D datasets.sub_sample
To reduce computation time, you may set the it to be 2 in the 3D dataset to reduce the number of samples.nb_trajectories
In real 3D data, there will be many trajectories. To randomly pick a specific amount of them you could change the number of it.- After finishing the above settings you could run the program and check the result.
To plug in your own data:
M = len(Data)
N = len(Data[0]) # Number of samples
M = int(M / 2) # Dimension
Xi_ref = Data[0:M, :] # Position
Xi_dot_ref = Data[M:, :] # Velocity
est_options = Est_options() # create a empty option class
- Finally pass them into fit_gmm
fig_gmm(Xi_ref, Xi_dot_ref, est_options)
**2D Datasets**
**3D Datasets**
References
[1] Figueroa, N. and Billard, A. (2018) "A Physically-Consistent Bayesian Non-Parametric Mixture Model for Dynamical System Learning". In Proceedings of the 2nd Conference on Robot Learning (CoRL).
Dependencies: