
This repository is a list of machine learning libraries written in Rust.
It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers.
This repository is targeted at people who are thinking of migrating from Python. 🦀🐍
It is divided into several basic library and algorithm categories.
And it also contains libraries that are no longer maintained and small libraries.
It has commented on the helpful parts of the code.
It also commented on good libraries within each category.
We can find a better way to use Rust for Machine Learning.
ToC
Jupyter Notebook
evcxr can be handled as Jupyter Kernel or REPL. It is helpful for learning and validation.
Graph Plot
It might want to try plotters for now.
ASCII line graph:
Examples:
Vector
Most things use ndarray or std::vec.
Also, look at nalgebra. When the size of the matrix is known, it is valid.
See also: ndarray vs nalgebra - reddit
Dataframe
It might want to try polars for now. datafusion looks good too.
Image Processing
It might want to try image-rs for now. Algorithms such as linear transformations are implemented in other libraries as well.
- image-rs/image - Encoding and decoding images in Rust
- rust-cv/ndarray-image - Allows conversion between ndarray's types and image's types
- rust-cv/cv - Rust CV mono-repo. Contains pure-Rust dependencies which attempt to encapsulate the capability of OpenCV, OpenMVG, and vSLAM frameworks in a cohesive set of APIs.
- twistedfall/opencv-rust - Rust bindings for OpenCV 3 & 4
- rustgd/cgmath - A linear algebra and mathematics library for computer graphics.
- atomashpolskiy/rustface - Face detection library for the Rust programming language
Natural Language Processing (preprocessing)
- google-research/deduplicate-text-datasets - This repository contains code to deduplicate language model datasets as descrbed in the paper "Deduplicating Training Data Makes Language Models Better" by Katherine Lee, Daphne Ippolito, Andrew Nystrom, Chiyuan Zhang, Douglas Eck, Chris Callison-Burch and Nicholas Carlini. This repository contains both the ExactSubstr deduplication implementation (written in Rust) along with the scripts we used in the paper to perform deduplication and inspect the results (written in Python). In an upcoming update, we will add files to reproduce the NearDup-deduplicated versions of the C4, RealNews, LM1B, and Wiki-40B-en datasets.
- pemistahl/lingua-rs - 👄 The most accurate natural language detection library in the Rust ecosystem, suitable for long and short text alike
- usamec/cntk-rs - Wrapper around Microsoft CNTK library
- stickeritis/sticker - A LSTM/Transformer/dilated convolution sequence labeler
- tensordot/syntaxdot - Neural syntax annotator, supporting sequence labeling, lemmatization, and dependency parsing.
- christophertrml/rs-natural - Natural Language Processing for Rust
- bminixhofer/nnsplit - Semantic text segmentation. For sentence boundary detection, compound splitting and more.
- greyblake/whatlang-rs - Natural language detection library for Rust.
- finalfusion/finalfrontier - Context-sensitive word embeddings with subwords. In Rust.
- bminixhofer/nlprule - A fast, low-resource Natural Language Processing and Error Correction library written in Rust.
- rth/vtext - Simple NLP in Rust with Python bindings
- tamuhey/tokenizations - Robust and Fast tokenizations alignment library for Rust and Python
- vgel/treebender - A HDPSG-inspired symbolic natural language parser written in Rust
- reinfer/blingfire-rs - Rust wrapper for the BlingFire tokenization library
- CurrySoftware/rust-stemmers - Common stop words in a variety of languages
- cmccomb/rust-stop-words - Common stop words in a variety of languages
- Freyskeyd/nlp - Rust-nlp is a library to use Natural Language Processing algorithm with RUST
- Daniel-Liu-c0deb0t/uwu - fastest text uwuifier in the west
Graphical Modeling
Interface & Pipeline & AutoML
Workflow
GPU
Comprehensive (like sklearn)
All libraries support the following algorithms.
- Linear Regression
- Logistic Regression
- K-Means Clustering
- Neural Networks
- Gaussian Process Regression
- Support Vector Machines
- kGaussian Mixture Models
- Naive Bayes Classifiers
- DBSCAN
- k-Nearest Neighbor Classifiers
- Principal Component Analysis
- Decision Tree
- Support Vector Machines
- Naive Bayes
- Elastic Net
It might want to try smartcore or linfa for now.
Comprehensive (Statistics)
- statrs-dev/statrs - Statistical computation library for Rust
- rust-ndarray/ndarray-stats - Statistical routines for ndarray
- Axect/Peroxide - Rust numeric library with R, MATLAB & Python syntax
- Linear Algebra, Functional Programming, Automatic Differentiation, Numerical Analysis, Statistics, Special functions, Plotting, Dataframe
- tarcieri/micromath - Embedded Rust arithmetic, 2D/3D vector, and statistics library
Gradient Boosting
Deep Neural Network
Tensorflow bindings and PyTorch bindings are the most common.
tch-rs also has torch vision, which is useful.
Graph Model
- Synerise/cleora - Cleora AI is a general-purpose model for efficient, scalable learning of stable and inductive entity embeddings for heterogeneous relational data.
- Pardoxa/net_ensembles - Rust library for random graph ensembles
Natural Language Processing (model)
Recommendation
Full Text Search
Nearest Neighbor Search
- Enet4/faiss-rs - Rust language bindings for Faiss
- rust-cv/hnsw - HNSW ANN from the paper "Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs"
- hora-search/hora - 🚀 efficient approximate nearest neighbor search algorithm collections library, which implemented with Rust 🦀. horasearch.com
- InstantDomain/instant-distance - Fast approximate nearest neighbor searching in Rust, based on HNSW index
- lerouxrgd/ngt-rs - Rust wrappers for NGT approximate nearest neighbor search
- granne/granne - Graph-based Approximate Nearest Neighbor Search
- u1roh/kd-tree - k-dimensional tree in Rust. Fast, simple, and easy to use.
- qdrant/qdrant - Qdrant - vector similarity search engine with extended filtering support
- rust-cv/hwt - Hamming Weight Tree from the paper "Online Nearest Neighbor Search in Hamming Space"
- fulara/kdtree-rust - kdtree implementation for rust.
- mrhooray/kdtree-rs - K-dimensional tree in Rust for fast geospatial indexing and lookup
- kornelski/vpsearch - C library for finding nearest (most similar) element in a set
- petabi/petal-neighbors - Nearest neighbor search algorithms including a ball tree and a vantage point tree.
- ritchie46/lsh-rs - Locality Sensitive Hashing in Rust with Python bindings
- kampersanda/mih-rs - Rust implementation of multi-index hashing for neighbor searches on 64-bit codes in the Hamming space
Reinforcement Learning
Supervised Learning Model
Unsupervised Learning & Clustering Model
Statistical Model
- Redpoll/changepoint - Includes the following change point detection algorithms: Bocpd -- Online Bayesian Change Point Detection Reference. BocpdTruncated -- Same as Bocpd but truncated the run-length distribution when those lengths are unlikely.
- krfricke/arima - ARIMA modelling for Rust
- Daingun/automatica - Automatic Control Systems Library
- rbagd/rust-linearkalman - Kalman filtering and smoothing in Rust
- sanity/pair_adjacent_violators - An implementation of the Pair Adjacent Violators algorithm for isotonic regression in Rust
Evolutionary Algorithm
Reference
Nearby Projects
Blogs
Introduction
- About Rust’s Machine Learning Community, Medium, 2016/1/6, Autumn Engineering
- Rust vs Python: Technology And Business Comparison, 2021/3/4, Miłosz Kaczorowski
- I wrote one of the fastest DataFrame libraries, 2021/2/28, Ritchie Vink
- Polars: The fastest DataFrame library you've never heard of 2021/1/19, Analytics Vidhya
- Data Manipulation: Polars vs Rust, 2021/3/13, Xavier Tao
- State of Machine Learning in Rust – Ehsan's Blog, 2019/5/13, Published by Ehsan
- Ritchie Vink, Machine Learning Engineer, writes Polars, one of the fastest DataFrame libraries in Python and Rust, Xomnia, 2021/5/11
- Quickwit: A highly cost-efficient search engine in Rust, 2021/7/13, quickwit, PAUL MASUREL
- Data Manipulation: Polars vs Rust, 2021/3/13, Xavier Tao
- Check out Rust in Production, 2021/8/10, Qovery, @serokell
- Why I started Rust instead of stick to Python, 2021/9/26, Medium, Geek Culture, Marshal SHI
Tutorial
- Rust Machine Learning Book, Examples of KMeans and DBSCAN with linfa-clustering
- Artificial Intelligence and Machine Learning – Practical Rust Projects: Building Game, Physical Computing, and Machine Learning Applications – Dev Guis , 2021/5/19
- Machine learning in Rust using Linfa, LogRocket Blog, 2021/4/30, Timeular, Mario Zupan, Examples of LogisticRegression
- Machine Learning in Rust, Smartcore, Medium, The Startup, 2021/1/15, Vlad Orlov, Examples of LinerRegression, Random Forest Regressor, and K-Fold
- Machine Learning in Rust, Logistic Regression, Medium, The Startup, 2021/1/6, Vlad Orlov
- Machine Learning in Rust, Linear Regression, Medium, The Startup, 2020/12/16, Vlad Orlov
- Machine Learning in Rust, 2016/3/7, James, Examples of LogisticRegressor
- Machine Learning and Rust (Part 1): Getting Started!, Level Up Coding, 2021/1/9, Stefano Bosisio
- Machine Learning and Rust (Part 2): Linear Regression, Level Up Coding, 2021/6/15, Stefano Bosisio
- Machine Learning and Rust (Part 3): Smartcore, Dataframe, and Linear Regression, Level Up Coding, 2021/7/1, Stefano Bosisio
- Tensorflow Rust Practical Part 1, Programmer Sought, 2018
- A Machine Learning introduction to ndarray, RustFest 2019, 2019/11/12, Luca Palmieri
- Simple Linear Regression from scratch in Rust, Web Development, Software Architecture, Algorithms and more, 2018/12/13, philipp
- Interactive Rust in a REPL and Jupyter Notebook with EVCXR, Depth-First, 2020/9/21, Richard L. Apodaca
- Rust for Data Science: Tutorial 1, dev, 2021/8/25, Davide Del Papa
- petgraph_review, 2019/10/11, Timothy Hobbs
- Rust for ML. Rust, Medium, Tempus Ex, 2021/8/1, Michael Naquin
- Adventures in Drone Photogrammetry Using Rust and Machine Learning (Image Segmentation with linfa and DBSCAN), 2021/11/14, CHRISTOPHER MORAN
Apply
- Deep Learning in Rust: baby steps, Medium, 2016/2/2, Theodore DeRego
- A Rust SentencePiece implementation, Rust NLP tales, 2020/5/30
- Accelerating text generation with Rust, Rust NLP tales, 2020/11/21
- A Simple Text Summarizer written in Rust, Towards Data Science, 2020/11/24, Charles Chan, Examples of Text Sentence Vector, Cosine Distance and PageRank
- Extracting deep learning image embeddings in Rust, RecoAI, 2021/6/1, Paweł Jankiewic, Examples of ONNX
- Deep Learning in Rust with GPU, 2021/7/30, Xavier Tao
- tch-rs pretrain example - Docker for PyTorch rust bindings tch-rs. Example of pretrain model, 2021/8/15, vaaaaanquish
- Rust ANN search Example - Image search example by approximate nearest-neighbor library In Rust, 2021/8/15, vaaaaanquish
- dzamkov/deep-learning-test - Implementing deep learning in Rust using just a linear algebra library (nalgebra), 2021/8/30, dzamkov
- vaaaaanquish/rust-machine-learning-api-example - The axum example that uses resnet224 to infer images received in base64 and returns the results., 2021/9/7, vaaaaanquish
- Rust for Machine Learning: Benchmarking Performance in One-shot - A Rust implementation of Siamese Neural Networks for One-shot Image Recognition for benchmarking performance and results, UofT Machine Intelligence Student Team
- Why Wallaroo Moved From Pony To Rust, 2021/8/19, Wallaroo.ai
- epwalsh/rust-dl-webserver - Example of serving deep learning models in Rust with batched prediction, 2021/11/16, epwalsh
Case study
- Production users - Rust Programming Language, by rust-lang.org
- Taking ML to production with Rust: a 25x speedup, A LEARNING JOURNAL, 2019/12/1, @algo_luca
- 9 Companies That Use Rust in Production, serokell, 2020/11/18, Gints Dreimanis
- Masked Language Model on Wasm, BERT on flontend examples, optim-corp/masked-lm-wasm, 2021/8/27, Optim
- Serving TensorFlow with Actix-Web, kykosic/actix-tensorflow-example
- Serving PyTorch with Actix-Web, kykosic/actix-pytorch-example
Discussion
- Natural Language Processing in Rust : rust, 2016/12/6
- Future prospect of Machine Learning in Rust Programming Language : MachineLearning, 2017/11/11
- Interest for NLP in Rust? - The Rust Programming Language Forum, 2018/1/19
- Is Rust good for deep learning and artificial intelligence? - The Rust Programming Language Forum, 2018/11/18
- ndarray vs nalgebra : rust, 2019/5/28
- Taking ML to production with Rust | Hacker News, 2019/12/2
- Who is using Rust for Machine learning in production/research? : rust, 2020/4/5
- Deep Learning in Rust, 2020/8/26
- SmartCore, fast and comprehensive machine learning library for Rust! : rust, 2020/9/29
- Deep Learning in Rust with GPU on ONNX, 2021/7/31
- Rust vs. C++ the main differences between these popular programming languages, 2021/8/25
- I wanted to share my experience of Rust as a deep learning researcher, 2021/9/2
- How far along is the ML ecosystem with Rust?, 2021/9/15
Books
Movie
- The /r/playrust Classifier: Real World Rust Data Science, RustConf 2016, 2016/10/05, Suchin Gururangan & Colin O'Brien
- Building AI Units in Rust, FOSSASIA 2018, 2018/3/25, Vigneshwer Dhinakaran
- Python vs Rust for Simulation, EuroPython 2019, 2019/7/10, Alisa Dammer
- Machine Learning is changing - is Rust the right tool for the job?, RustLab 2019, 2019/10/31, Luca Palmieri
- Using TensorFlow in Embedded Rust, 2020/09/29, Ferrous Systems GmbH, Richard Meadows
- Writing the Fastest GBDT Library in Rust, 2021/09/16, RustConf 2021, Isabella Tromba
PodCast
Paper
- End-to-end NLP Pipelines in Rust, Proceedings of Second Workshop for NLP Open Source Software (NLP-OSS), pages 20–25 Virtual Conference, 2020/11/19, Guillaume Becquin
How to contribute
Please just update the README.md.
If you update this README.md, CI will be executed automatically.
And the website will also be updated.
Thanks
Thanks for all the projects.
https://github.com/vaaaaanquish/Awesome-Rust-MachineLearning