All Projects → subhadarship → Kmeans_pytorch

subhadarship / Kmeans_pytorch

Licence: mit
kmeans using PyTorch

Projects that are alternatives of or similar to Kmeans pytorch

Fastpages
An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
Stars: ✭ 2,888 (+2846.94%)
Mutual labels:  jekyll, github-pages, jupyter-notebook
Hyperlearn
50% faster, 50% less RAM Machine Learning. Numba rewritten Sklearn. SVD, NNMF, PCA, LinearReg, RidgeReg, Randomized, Truncated SVD/PCA, CSR Matrices all 50+% faster
Stars: ✭ 1,204 (+1128.57%)
Mutual labels:  jupyter-notebook, gpu
Jekyll Katex
Jekyll plugin for easy server-side math rendering via KaTeX
Stars: ✭ 73 (-25.51%)
Mutual labels:  jekyll, github-pages
Garth
🥁 A really basic theme for Jekyll
Stars: ✭ 85 (-13.27%)
Mutual labels:  jekyll, github-pages
Jglovier.github.io
📓 Source for joelglovier.com. Built with Jekyll and hosted on GitHub Pages.
Stars: ✭ 98 (+0%)
Mutual labels:  jekyll, github-pages
Jekyll Github Deploy
Jekyll Site Automated Deployer to GitHub Pages
Stars: ✭ 67 (-31.63%)
Mutual labels:  jekyll, github-pages
Glove As A Tensorflow Embedding Layer
Taking a pretrained GloVe model, and using it as a TensorFlow embedding weight layer **inside the GPU**. Therefore, you only need to send the index of the words through the GPU data transfer bus, reducing data transfer overhead.
Stars: ✭ 85 (-13.27%)
Mutual labels:  jupyter-notebook, gpu
Merlot
Merlot is a Jekyll theme for GitHub Pages
Stars: ✭ 52 (-46.94%)
Mutual labels:  jekyll, github-pages
Deep Learning Boot Camp
A community run, 5-day PyTorch Deep Learning Bootcamp
Stars: ✭ 1,270 (+1195.92%)
Mutual labels:  jupyter-notebook, gpu
Pytorch
PyTorch tutorials A to Z
Stars: ✭ 87 (-11.22%)
Mutual labels:  jupyter-notebook, gpu
Brew.sh
🔖 The Homebrew homepage
Stars: ✭ 91 (-7.14%)
Mutual labels:  jekyll, github-pages
Microdust
My personal blog Microdust
Stars: ✭ 63 (-35.71%)
Mutual labels:  jekyll, github-pages
Aiopen
AIOpen是一个按人工智能三要素(数据、算法、算力)进行AI开源项目分类的汇集项目,项目致力于跟踪目前人工智能(AI)的深度学习(DL)开源项目,并尽可能地罗列目前的开源项目,同时加入了一些曾经研究过的代码。通过这些开源项目,使初次接触AI的人们对人工智能(深度学习)有更清晰和更全面的了解。
Stars: ✭ 62 (-36.73%)
Mutual labels:  jupyter-notebook, gpu
Dinky
Dinky is a Jekyll theme for GitHub Pages
Stars: ✭ 70 (-28.57%)
Mutual labels:  jekyll, github-pages
Memory Efficient Maml
Memory efficient MAML using gradient checkpointing
Stars: ✭ 60 (-38.78%)
Mutual labels:  jupyter-notebook, gpu
Covid19 Dashboard
A site that displays up to date COVID-19 stats, powered by fastpages.
Stars: ✭ 1,212 (+1136.73%)
Mutual labels:  github-pages, jupyter-notebook
Neumorphism
Neumorphism designed Jekyll theme for personal websites, portfolios and resumes.
Stars: ✭ 96 (-2.04%)
Mutual labels:  jekyll, github-pages
Minimal Mistakes
📐 Jekyll theme for building a personal site, blog, project documentation, or portfolio.
Stars: ✭ 8,967 (+9050%)
Mutual labels:  jekyll, github-pages
Mzlogin.github.io
Jekyll Themes / GitHub Pages 博客模板 / A template repository for Jekyll based blog
Stars: ✭ 1,060 (+981.63%)
Mutual labels:  jekyll, github-pages
Training Material
A collection of code examples as well as presentations for training purposes
Stars: ✭ 85 (-13.27%)
Mutual labels:  jupyter-notebook, gpu

K Means using PyTorch

PyTorch implementation of kmeans for utilizing GPU

Alt Text

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, distance='euclidean', device=torch.device('cuda:0')
)

see example.ipynb for a more elaborate example

Requirements

  • PyTorch version >= 1.0.0
  • Python version >= 3.6

Installation

install with pip:

pip install kmeans-pytorch

Installing from source

To install from source and develop locally:

git clone https://github.com/subhadarship/kmeans_pytorch
cd kmeans_pytorch
pip install --editable .

CPU vs GPU

see cpu_vs_gpu.ipynb for a comparison between CPU and GPU

Notes

  • useful when clustering large number of samples
  • utilizes GPU for faster matrix computations
  • support euclidean and cosine distances (for now)

Credits

  • This implementation closely follows the style of this
  • Documentation is done using the awesome theme jekyllbook

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].