Registry / Framework

framework · v0.2.0
BlyxTorch
Train dense networks with SGD or Adam, inspect parameter gradients, and generate standalone Blyx models for regression or classification.
Use BlyxTorch
use vendor::blyxtorch::blyxtorch;
Run the example
nest demo blyxtorch@0.2.0
blyxc native-run blyxtorch-demo/main.blyx
Example source and expected output
use vendor::blyxtorch::blyxtorch;
fn main() {
let weight = bt_dual(1.0, 1.0);
let x = bt_dual(2.0, 0.0);
let target = bt_dual(5.0, 0.0);
let loss = bt_square(bt_sub(bt_mul(weight, x), target));
println!(at(loss, 0));
println!(at(loss, 1));
let updated = bt_dual(at(weight, 0) - 0.125 * at(loss, 1), 0.0);
println!(at(bt_square(bt_sub(bt_mul(updated, x), target)), 0));
}
Expected output
9
-12
0
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.2.0 | Download ZIP | 6b67ab026a | cbb1bdedf7b4d639fb09265052cab9b280a197c76b944bc62514ad2379757746 |