Calculating kmeans on a GPU

3 visualizaciones (últimos 30 días)
Mailz Daizan
Mailz Daizan el 11 de Sept. de 2017
Respondida: Mailz Daizan el 12 de Sept. de 2017
Kind time of the day, dear inhabitants of the forum. I want to ask whether anyone can help me calculate the clustering of kmeans on a GPU it is not included in the standard function gpuArray but it can be calculated as a user-defined function But how to do that? I'm new to matlab and can not figure out how to implement it.

Respuesta aceptada

Joss Knight
Joss Knight el 11 de Sept. de 2017
Editada: Joss Knight el 11 de Sept. de 2017
gpuArray support for kmeans was added to MATLAB in R2016a
>> help gpuArray/kmeans
kmeans K-means clustering for GPU data
IDX = kmeans(X, K)
[IDX, C] = kmeans(X, K)
[IDX, C, SUMD] = kmeans(X, K)
[IDX, C, SUMD, D] = kmeans(X, K)
[ ... ] = kmeans(..., 'PARAM1',val1, 'PARAM2',val2, ...)
Example:
N = 1e6;
X = gpuArray([randn(N,2)+ones(N,2); randn(N,2)-ones(N,2)]);
[cidx, ctrs] = kmeans(X, 2);
See also kmeans, gpuArray.

Más respuestas (2)

Walter Roberson
Walter Roberson el 11 de Sept. de 2017
Editada: Walter Roberson el 11 de Sept. de 2017

Mailz Daizan
Mailz Daizan el 12 de Sept. de 2017
Thank you all very much for the answers, I'll get to the weekend before PC I'll try it!

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by