kmeans_pytorch:使用PyTorch的kmeans 源码
使用PyTorch的K均值 kmeans的PyTorch实现以利用GPU 入门 import torch import numpy as np from kmeans_pytorch import kmeans # data data_size, dims, num_clusters = 1000, 2, 3 x = np.random.randn(data_size, dims) / 6 x = torch.from_numpy(x) # kmeans cluster_ids_x, cluster_centers = kmeans( X=x, num_clusters=num_clu
用户评论