Wrapper around Microsoft CNTK library

Overview

Bindings for CNTK library

Simple low level bindings for CNTK library from Microsoft.

API Documentation

Status

Currently exploring ways how to interact with C++ API nicely from Rust. Expect a lot of breaking changes.

Build scripts are not ready yet, might not work outside of 64bit linux.

Goals

  • Ability to train all reasonable architectures
  • No memory leaks
  • Reasonable ease of use

Nongoals

  • Idiomatic Rust everywhere
  • Super good ergonomics
  • Avoiding all unnecessary copies

Building and installing

You need to have CNTK-2.3 installed and paths to includes and library files in relevant enviroment variables (cntk activate scripts does this well). You also need g++-4.8 installed (because CNTK uses it to compile things).

Example usage

See examples folder.

Other limitations

Only works with single precision (f32 in Rust, float in C++) types. Only works with dense representations of vectors/matrices/tensors. Only works with ASCII strings for variable names and filenames.

What works

  • Passing data in and out of computation.
  • Backpropagation.
  • Training fully connected feedforward, convolutional and recurrent network.
  • Saving and loading the model.
  • Code for most operations. - Almost all, except couple of helpers.
  • Demo of seq2seq model training.
  • Turning c++ exception into rust panics (most of the time).
  • Interop with NDArray library.

Planned in future

  • GPU.
  • Better docs.
  • Finish all operations.
  • Better build scripts.
  • Figure out whether we want NDArrayView or go directly from Rust data to Value and back.
  • Builder pattern where appropriate (Variable?).
You might also like...
Simple neural network library for classification written in Rust.

Cogent A note I continue working on GPU stuff, I've made some interesting things there, but ultimately it made me realise this is far too monumental a

RustFFT is a high-performance FFT library written in pure Rust.

RustFFT is a high-performance FFT library written in pure Rust. It can compute FFTs of any size, including prime-number sizes, in O(nlogn) time.

Rust crate to create Anki decks. Based on the python library genanki

genanki-rs: A Rust Crate for Generating Anki Decks With genanki-rs you can easily generate decks for the popular open source flashcard platform Anki.

Generic Automatic Differentiation library for Rust (aka "autograd")

GAD: Generic Automatic Differentiation for Rust This project aims to provide a general and extensible framework for tape-based automatic differentiati

Network-agnostic, high-level game networking library for client-side prediction and server reconciliation.
Network-agnostic, high-level game networking library for client-side prediction and server reconciliation.

WARNING: This crate currently depends on nightly rust unstable and incomplete features. crystalorb Network-agnostic, high-level game networking librar

Msgpack serialization/deserialization library for Python, written in Rust using PyO3, and rust-msgpack. Reboot of orjson. msgpack.org[Python]

ormsgpack ormsgpack is a fast msgpack library for Python. It is a fork/reboot of orjson It serializes faster than msgpack-python and deserializes a bi

MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone

MesaTEE GBDT-RS : a fast and secure GBDT library, supporting TEEs such as Intel SGX and ARM TrustZone MesaTEE GBDT-RS is a gradient boost decision tre

l2 is a fast, Pytorch-style Tensor+Autograd library written in Rust
l2 is a fast, Pytorch-style Tensor+Autograd library written in Rust

l2 • 🤖 A Pytorch-style Tensor+Autograd library written in Rust Installation • Contributing • Authors • License • Acknowledgements Made by Bilal Khan

C library for finding nearest (most similar) element in a set

VP-tree nearest neighbor search A relatively simple and readable Rust implementation of Vantage Point tree search algorithm. The VP tree algorithm doe

Comments
  • error when building on ubuntu machines

    error when building on ubuntu machines

    Getting the error when building on an ubuntu machine

    cargo:warning=/usr/include/c++/5/bits/cxxabi_forced.h:36:37: error: expected declaration before end of line
    exit code: 1
    
    opened by infinite-Joy9l 1
  • not able to build on ubuntu

    not able to build on ubuntu

    I have been trying to build this library on ubuntu machines without success. First discovered that the files such as these needs to be copied manually to the system. Currently this is the error that is showing up.

       Compiling cntk v0.2.1 (/home/saionee/opensource/programming-languages/rust-lang/cntk-rs)
    error: recursion limit reached while expanding the macro `__cpp_internal`
       --> src/ops.rs:134:23
        |
    134 |           let payload = cpp!([xpayload as "Variable", adata_ptr as "Axis*", len as "size_t", bdata_ptr as "int*", edata_ptr as "int*", mut error_p as "char*"] -> FunctionInner as "FunctionPtr" {
        |  _______________________^
    135 | |             try {
    136 | |                 return Slice(xpayload,
    137 | |                              vector<Axis>(adata_ptr, adata_ptr + len),
    ...   |
    145 | |             }
    146 | |         });
        | |__________^
        |
        = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
        = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
    
    error: aborting due to previous error
    

    Are there better build instruction as I am not able to figure this thing out.

    opened by infinite-Joy9l 1
Owner
Vlado Boza
Vlado Boza
Messing around with deep learning

Deep Learning Test Implementing deep learning in Rust using just a linear algebra library (nalgebra). The neural network (4 hidden layers, 32 neurons

Dmitry Zamkov 9 Jun 22, 2022
Rust wrapper for the Fast Artificial Neural Network library

fann-rs Rust wrapper for the Fast Artificial Neural Network (FANN) library. This crate provides a safe interface to FANN on top of the low-level bindi

Andreas Fackler 12 Jul 17, 2022
A Rusty CUDA wrapper

cuda-oxide cuda-oxide is a safe wrapper for CUDA. With cuda-oxide you can execute and coordinate CUDA kernels. Safety Philosophy cuda-oxide does not o

Max Bruce 30 Dec 7, 2022
Rust-port of spotify/annoy as a wrapper for Approximate Nearest Neighbors in C++/Python optimized for memory usage.

Rust-port of spotify/annoy as a wrapper for Approximate Nearest Neighbors in C++/Python optimized for memory usage.

Arthur·Thomas 13 Mar 10, 2022
Rust-port of spotify/annoy as a wrapper for Approximate Nearest Neighbors in C++/Python optimized for memory usage.

Fareast This library is a rust port of spotify/annoy , currently only index serving is supported. It also provides FFI bindings for jvm, dotnet and da

Arthur·Thomas 13 Mar 10, 2022
Machine Learning library for Rust

rusty-machine This library is no longer actively maintained. The crate is currently on version 0.5.4. Read the API Documentation to learn more. And he

James Lucas 1.2k Dec 31, 2022
Rust library for Self Organising Maps (SOM).

RusticSOM Rust library for Self Organising Maps (SOM). Using this Crate Add rusticsom as a dependency in Cargo.toml [dependencies] rusticsom = "1.1.0"

Avinash Shenoy 26 Oct 17, 2022
Rust numeric library with R, MATLAB & Python syntax

Peroxide Rust numeric library contains linear algebra, numerical analysis, statistics and machine learning tools with R, MATLAB, Python like macros. W

Tae Geun Kim 351 Dec 29, 2022
A deep learning library for rust

Alumina An experimental deep learning library written in pure rust. Breakage expected on each release in the short term. See mnist.rs in examples or R

zza 95 Nov 30, 2022
Machine Learning Library for Rust

autograph Machine Learning Library for Rust undergoing maintenance Features Portable accelerated compute Run SPIR-V shaders on GPU's that support Vulk

null 223 Jan 1, 2023