kmeans-pytorch · PyPI
https://pypi.org/project/kmeans-pytorch03.02.2020 · K Means using PyTorch. PyTorch implementation of kmeans for utilizing GPU. Getting Started 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, …
K Means using PyTorch · kmeans PyTorch
https://subhadarship.github.io/kmeans_pytorchK Means using PyTorch. PyTorch implementation of kmeans for utilizing GPU. Getting Started 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_clusters, …
GitHub - rusty1s/pytorch_cluster: PyTorch Extension ...
https://github.com/rusty1s/pytorch_clusterA clustering algorithm, which overlays a regular grid of user-defined size over a point cloud and clusters all points within a voxel. import torch from torch_cluster import grid_cluster pos = torch. tensor ( [ [ 0., 0. ], [ 11., 9. ], [ 2., 8. ], [ 2., 2. ], [ 8., 3. ]]) size = torch. Tensor ( [ 5, 5 ]) cluster = grid_cluster ( pos, size)