Floretta
Floretta is an automatic differentiation tool for WebAssembly. This crate is the Rust library; for the command line interface, see the floretta-cli crate.
To install:
Here are some usage examples, assuming you have wat and Wasmtime installed.
Forward mode
Use Autodiff::new to create an empty config, then use Autodiff::forward to transform a Wasm module to compute derivatives in forward mode.
use Autodiff;
use ;
let input = parse_str.unwrap;
let output = new.forward.unwrap;
let engine = default;
let mut store = new;
let module = new.unwrap;
let instance = new.unwrap;
let square = instance..unwrap;
assert_eq!;
Reverse mode
Create an empty config via Autodiff::new, use Autodiff::export to specify one or more functions to export the backward pass, and then use Autodiff::reverse to transform a Wasm module to compute derivatives in reverse mode.
use Autodiff;
use ;
let input = parse_str.unwrap;
let mut ad = new;
ad.export;
let output = ad.reverse.unwrap;
let engine = default;
let mut store = new;
let module = new.unwrap;
let instance = new.unwrap;
let square = instance..unwrap;
let backprop = instance..unwrap;
assert_eq!;
assert_eq!;