GPU for HMM training
이전 댓글 표시
Hi I have a large dataset and when I used hidden markov model to train the data I have to wait a long time. Would GPU parallel computing speed this up. It seems the HMM (in the stats toolbox) is not mentioned as a supported function within the it.
Any experience or ideas?
채택된 답변
추가 답변 (2개)
John Melonakos
2011년 6월 7일
Jacket has been used heavily for HMMs on the GPU in MATLAB. K-Means is also really fast. Here is some sample code:
% initial points
n = 1e6; % 3e6;
X = [randn(n,1) randn(n,1)] * 2;
ind = ceil(6*rand(n,1));
X(ind<3,1) = X(ind<3,1)/2 - 7;
X(ind==4,:) = X(ind==4,:)/3 + 4;
X = X';
% cluster
k = 20; % 5 clusters
X = gsingle(X);
[d n] = size(X);
assert(d == 2); % just for 2D case
% initial state
Z = X(:, ceil(1:n/k:n));
Z = reshape(Z, [2 1 k]);
% kmeans phase 1, 10 iterations
tic
for i = 1:10, i
% distances
D = bsxfun(@minus, X, Z);
D = sum(D .* D);
D = permute(D, [3 2 1]);
% minimum distances
[Y, I] = min(D);
% re-assign clusters
for j = 1:k
ii = find(I == j); if isempty(ii), error('empty cluster'); end
Z(:,1,j) = mean(X(:,ii), 2);
end
end
toc
engstudent
2012년 12월 7일
0 개 추천
hi every one i am working in isolated word recognition and i need the step to use the hmm in matlab 2012, if any one can help me please send help to my email"sajasaad_eng@yahoo.com".
카테고리
도움말 센터 및 File Exchange에서 Parallel and Cloud에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!