3 ms·
Maybe interfacing w an ml lib like pytorch or something?
by djohnston 7y ago
Maybe interfacing w an ml lib like pytorch or something?
- RcouF1uZ4gsC 7y agoFor pytorch it would probably be easier to do something based off the pytorch C++ interface.
- djohnston 7y agoSure, I've never even used pytorch. But I'm just saying python has a fair bit of data analysis and ml tools that probably haven't found native homes in rust
- qchris 7y agoI suppose you could, but I believe that there are direct bindings from Rust to Pytorch at https://github.com/LaurentMazare/tch-rs https://github.com/LaurentMazare/tch-rs. I haven't used it personally, but I've heard fairly good things about it's correctness and responsive maintainer.
- danieldk 7y agoI have written a transformer-based (BERT, XLM-RoBERTa) sequence labeler/lemmatizer/dependency parser in Rust with tch-rs [1] and it is great! Some parts do not feel rusty. E.g. dynamic typing of tensors, you get a Tensor rather than Tensor<f32>, but that's more due to how libtorch itself works. But it's a very straightforward API that exposes most of libtorch. The maintainer is also very nice and responsive. I was also amazed how much is implemented in libtorch itself as opposed to the Python wrapper, which makes much of the Torch functionality available to other languages. [1] https://github.com/stickeritis/sticker2 https://github.com/stickeritis/sticker2 https://github.com/stickeritis/sticker-transformers https://github.com/stickeritis/sticker-transformers
- random32840 7y agoSomeone might have jumped that hurdle but the point is it circumvents that class of hurdle. What about the next framework which doesn't have bindings? What about leveraging existing Pytorch code that's written in Python?