estimateAttractorPath.m 1.8 KB
Newer Older
Milad Malekzadeh's avatar
Milad Malekzadeh committed
1 2 3
function r = estimateAttractorPath(DataIn, model, r)
% Estimation of an attractor path from a task-parameterized GMM and a set of candidate frames.
%
4 5 6 7
% Writing code takes time. Polishing it and making it available to others takes longer! 
% If some parts of the code were useful for your research of for a better understanding 
% of the algorithms, please reward the authors by citing the related publications, 
% and consider making your own research available in this way.
Milad Malekzadeh's avatar
Milad Malekzadeh committed
8
%
9 10 11 12 13
% @article{Calinon15,
%   author="Calinon, S.",
%   title="A Tutorial on Task-Parameterized Movement Learning and Retrieval",
%   journal="Intelligent Service Robotics",
%   year="2015"
Milad Malekzadeh's avatar
Milad Malekzadeh committed
14
% }
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
%
% Copyright (c) 2015 Idiap Research Institute, http://idiap.ch/
% Written by Sylvain Calinon, http://calinon.ch/
% 
% This file is part of PbDlib, http://www.idiap.ch/software/pbdlib/
% 
% PbDlib is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License version 3 as
% published by the Free Software Foundation.
% 
% PbDlib is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
% 
% You should have received a copy of the GNU General Public License
% along with PbDlib. If not, see <http://www.gnu.org/licenses/>.

Milad Malekzadeh's avatar
Milad Malekzadeh committed
33 34 35 36 37 38 39

in = 1:size(DataIn,1);
out = in(end)+1:model.nbVar;

%% Estimation of the attractor path by Gaussian mixture regression,
%% by using the GMM resulting from the product of linearly transformed Gaussians
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40
[r.Mu, r.Sigma] = productTPGMM0(model, r.p); 
Milad Malekzadeh's avatar
Milad Malekzadeh committed
41
r.Priors = model.Priors;
Milad Malekzadeh's avatar
Milad Malekzadeh committed
42 43
r.nbStates = model.nbStates;

44
[r.currTar, r.currSigma] = GMR(r, DataIn, in, out);