onnx-export-rs 0.1.1

Export canonical Rust machine-learning models to ONNX
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Writes a small multiclass logistic-regression model to `logistic.onnx`.

use ndarray::array;
use onnx_export_rs::{
    canonical::LogisticModelWeights, exporters::export_logistic, save_to_file, Result,
};

fn main() -> Result<()> {
    let weights = LogisticModelWeights::new(
        array![[1.0, 0.0], [0.0, 1.0], [-1.0, -1.0]],
        array![0.0, 0.0, 0.0],
        3,
    )?;
    save_to_file(&export_logistic(&weights), "logistic.onnx")
}