I took a class on Machine Learning this past quarter at college, and figured the best way to supplement and strengthen my understanding of the underlying mathematics and algorithms of the field (or at least the subset thereof which we learned) would be to implement them myself. I've been enjoying using Rust (I made a raytracer), hence the language choice. I'm also considering this project to be my way of simultaneously learning CUDA programming (for GPU acceleration on my NVIDIA card) and foreign function interfaces in Rust (since CUDA code is written in C/C++).
My aim is to use as few dependencies as is reasonable, so that I can focus on implementing the mathematics and ML stuff by myself.
- Efficient matrix and vector operations using CUDA kernels. This includes:
- Matrix addition; subtraction; scalar, matrix, and vector multiplication; and transpose.
- Vector addition, subtraction, scalar multiplication, and dot product.
(Bugs marked with [*] are considered high priority.)
- [*] There appears to be race conditions which cause
math::linear::vector::tests::test_dot_smaller_vecs
andlearning::instance::tests::test_normalize_instance
to fail inconsistently.
Rustdocs for this library are available here.
If you want to build from source, first, of course, clone the repository.
$ git clone https://github.com/arjunr00/ml-rust-cuda.git
$ cd ml-rust-cuda
To build, simply type:
$ cargo build
To run the built-in unit and documentation tests, type:
$ cargo test -- --test-threads=1
[TODO]