Rust efforts in AI


#1

As a matter of interest, are there any efforts with Rust in AI? I’ve heard about Leaf by AutumnAI but it looks like it’s been abandoned and am interested to hear if there’s other projects and efforts in the space.


#2

Leaf is abandoned, but there are efforts to revive as Juice. But those effort are slow.

As for other things. Things are mostly immature, do not support many things or are abandoned. There are many crates where you can construct feedforward network, but very few where you can construct sequence to sequence translation network.

In non deeplearning ML space (classic things like trees, logistic regression, SVMs, …), there is rustlearn and rusty-machine. Both semiabandoned and feature very incomplete. Rustlearn does only support binary classification (or one-vs-rest wrapping of it) and no regression. Rusty-machine does not support serialization or sparse data handling. And also each one of them comes with own matrix types.

And now comes shameless promotion of my efforts:
I have made wrapper for CNTK library (deeplearning from Microsoft). It is quite usable (you can do seq2seq there), but very low level (since it is build on top of CNTK C++ API, which is much more low level than their python API). But it comes with some reasonable examples.

I am also thinking about making something similar like python scikit-learn for Rust (yep another ML library). Right now I am mostly struggling with making unified API for NDArray and SPRS types.

And what is really missing is community. Both https://gitter.im/rust-ml/Lobby and #rust-machine-learning seem to be really quiet.


#3

Do you know what happened to AutumnAI (and Leaf)? Did they shut down?

Given the number of abandoned Rust ML projects, it’d be interesting to know if that’s at all a reflection on Rust readiness in this area or merely natural churn of OSS projects.


#4

They have a blog about it: https://medium.com/@mjhirn/tensorflow-wins-89b78b29aafb

Mostly too strong competition.


#5

does rust really help in this domain - isn’t it mostly a case of writing ‘utility code’ to setup the real work on the GPU, as such the ‘maths languages’ are fine

having said that I’ve heard of people pursuing all sorts r.e. training ( e.g. procedural environments to help generalise )


#6

Depends on the usage.
If your usage is “I have this file with training data on disk, create neural network, save it and then serve it using API”, then you will probably use Python and do not look back.

But when you have complicated usecase, two things might emerge:

  • Refactoring in Python (or other dynamic) language is hard.
  • You want to do some custom processing, which you cannot express easily in numpy/pandas/… (Python libraries, which call C) and you want it to be fast. Then you have to hookup Python with C/C++, which is not something completely trivial.

Also in overall architecture, sometimes you want ML predictions as a function call, not as an API call. It simplifies and sometimes speeds up things a lot.

Overall I would say, that Rust should not compete with Python in AI space, but with languages like Java/Scala (which have some ML going with them).


#7

I’m not sure if it’s exactly what your are looking for but this http://cityboundsim.com/ and the talk from RustFest https://www.youtube.com/watch?v=qr9GTTST_Dk may be of interest.