资源简介
高斯混合模型GMM 及高斯混合回归GMR MATLAB程序 供大家学习参考 有实例和图
代码片段和文件信息
function demo1
%
% Demo of Gaussian Mixture Regression (GMR).
% This source code is the implementation of the algorithms described in
% Section 2.4 p.38 of the book “Robot Programming by Demonstration: A
% Probabilistic Approach“.
%
% Author: Sylvain Calinon 2009
% http://programming-by-demonstration.org
%
% The program loads a 3D dataset trains a Gaussian Mixture Model
% (GMM) and retrieves a generalized version of the dataset with associated
% constraints through Gaussian Mixture Regression (GMR). Each datapoint
% has 3 dimensions consisting of 1 temporal value and 2 spatial values
% (e.g. drawing on a 2D Cartesian plane). A sequence of temporal values is
% used as query points to retrieve a sequence of expected spatial
% distributiuon through Gaussian Mixture Regression (GMR).
%
% This source code is given for free! However I would be grateful if you refer
% to the book (or corresponding article) in any academic publication that uses
% this code or part of it. Here are the corresponding BibTex references:
%
% @book{Calinon09book
% author=“S. Calinon“
% title=“Robot Programming by Demonstration: A Probabilistic Approach“
% publisher=“EPFL/CRC Press“
% year=“2009“
% note=“EPFL Press ISBN 978-2-940222-31-5 CRC Press ISBN 978-1-4398-0867-2“
% }
%
% @article{Calinon07
% title=“On Learning Representing and Generalizing a Task in a Humanoid Robot“
% author=“S. Calinon and F. Guenter and A. Billard“
% journal=“IEEE Transactions on Systems Man and Cybernetics Part B“
% year=“2007“
% volume=“37“
% number=“2“
% pages=“286--298“
% }
%% Definition of the number of components used in GMM. GMM中使用的组件数量的定义
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nbStates = 4;
%% Load a dataset consisting of 3 demonstrations of a 2D signal. 加载由3个2D信号演示组成的数据集
load(‘data/data1.mat‘); %load ‘Data‘
nbVar = size(Data1);
%% Training of GMM by EM algorithm initialized by k-means clustering. 通过EM算法对GMM进行训练,通过k均值聚类进行初始化。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[Priors Mu Sigma] = EM_init_kmeans(Data nbStates);
[Priors Mu Sigma] = EM(Data Priors Mu Sigma);
%% Use of GMR to retrieve a generalized version of the data and associated 使用GMR检索数据和相关约束的通用版本。 一系列时间值用作输入,并检索期望的分布。
%% constraints. A sequence of temporal values is used as input and the
%% expected distribution is retrieved.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
expData(1:) = linspace(min(Data(1:)) max(Data(1:)) 100);
[expData(2:nbVar:) expSigma] = GMR(Priors Mu Sigma expData(1:) [1] [2:nbVar]);
%% Plot of the data 数据图
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure(‘position‘[10101000800]‘name‘‘GMM-GMR-demo1‘);
%plot 1D
for n=1:nbVar-1
subplot(3*(nbVar-1)2(n-1)*2+1); hold on;
plot(Data(1:) Data(n+1:) ‘x‘ ‘markerSize‘ 4 ‘
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-22 13:41 GMM\
目录 0 2018-03-22 19:48 GMM\GMM-GMR-v2.0\
目录 0 2009-04-03 15:32 GMM\GMM-GMR-v2.0\data\
文件 7384 2008-04-18 10:26 GMM\GMM-GMR-v2.0\data\data1.mat
文件 9784 2008-04-18 10:26 GMM\GMM-GMR-v2.0\data\data2_a.mat
文件 1800 2008-04-18 10:26 GMM\GMM-GMR-v2.0\data\data2_b.mat
文件 7392 2008-04-18 10:27 GMM\GMM-GMR-v2.0\data\data3_a.mat
文件 7392 2008-04-18 10:27 GMM\GMM-GMR-v2.0\data\data3_b.mat
文件 4986 2018-03-21 11:45 GMM\GMM-GMR-v2.0\demo1.m
文件 4469 2009-07-22 13:29 GMM\GMM-GMR-v2.0\demo2.m
文件 6157 2009-07-22 13:28 GMM\GMM-GMR-v2.0\demo3.m
文件 5553 2009-07-22 13:29 GMM\GMM-GMR-v2.0\EM.m
文件 1645 2009-07-22 13:25 GMM\GMM-GMR-v2.0\EM_init_kmeans.m
文件 958 2009-07-22 13:25 GMM\GMM-GMR-v2.0\gaussPDF.m
文件 5374 2018-03-22 19:48 GMM\GMM-GMR-v2.0\GMR.m
文件 1985 2009-07-22 13:35 GMM\GMM-GMR-v2.0\plotGMM.m
目录 0 2014-06-18 19:23 GMM\task-parameterized-tensor-GMM-with-LQR\
目录 0 2014-02-11 22:42 GMM\task-parameterized-tensor-GMM-with-LQR\data\
文件 43247 2014-02-02 23:33 GMM\task-parameterized-tensor-GMM-with-LQR\data\DataLQR01.mat
文件 8715 2014-06-18 19:24 GMM\task-parameterized-tensor-GMM-with-LQR\demo01.m
文件 2328 2014-06-18 15:01 GMM\task-parameterized-tensor-GMM-with-LQR\demo_testLQR01.m
文件 2537 2014-06-18 15:01 GMM\task-parameterized-tensor-GMM-with-LQR\demo_testLQR02.m
文件 3113 2014-06-18 19:23 GMM\task-parameterized-tensor-GMM-with-LQR\EM_tensorGMM.m
文件 2163 2014-06-18 15:02 GMM\task-parameterized-tensor-GMM-with-LQR\estimateAttractorPath.m
文件 877 2014-02-02 20:58 GMM\task-parameterized-tensor-GMM-with-LQR\gaussPDF.m
文件 1123 2014-02-02 21:01 GMM\task-parameterized-tensor-GMM-with-LQR\init_tensorGMM_timeba
文件 938 2014-02-02 22:34 GMM\task-parameterized-tensor-GMM-with-LQR\plotGMM.m
文件 1907 2014-06-18 20:45 GMM\task-parameterized-tensor-GMM-with-LQR\readme.txt
文件 1384 2014-06-18 17:47 GMM\task-parameterized-tensor-GMM-with-LQR\reproduction_DS.m
文件 3189 2014-06-18 15:02 GMM\task-parameterized-tensor-GMM-with-LQR\reproduction_LQR_finiteHorizon.m
文件 2149 2014-06-18 15:01 GMM\task-parameterized-tensor-GMM-with-LQR\reproduction_LQR_infiniteHorizon.m
............此处省略0个文件信息
评论
共有 条评论