niura

Crates.ioniura
lib.rsniura
version0.1.0
created_at2022-05-24 22:59:37.330547+00
updated_at2022-05-24 22:59:37.330547+00
descriptionAutomatic differentiation in pure Rust.
homepage
repository
max_upload_size
id593098
size38,859
(taminki)

documentation

README

Niura is an automatic differentiation library written in Rust.

Add niura to your project

[dependencies]

niura = { git = "https://github.com/taminki/niura" }

Why

While there are a couple of libraries written in Rust that provide auto-differentiation capabilities, they mostly have a very verbose API syntax.

Niura aims to be as close as possible to symbolic mathemacs, with the major deviation being that you need to pass variables by reference, since differentiating with respect to a variable which has been dropped doesn't make sense.

Usage example

use niura::var::*;

fn main() {

    let a = var::float(2.0);
    let b = var::float(3.0);
    
    let c = tan(&(&a * &b));

    c.backward();
    println!("{}", a.grad()); 
}

What's next

This was built as an exploratory project in order to get to know how automatic differentiation works, so there isn't any concrete timeline.

However, I'm currently working on adding support for differentiating vector valued functions. And I want to add features for this to become a machine learning library in the future.

Commit count: 0

cargo fmt