nml
Niao Machine Learning
Machine learning in Niao: tensors, training loops, classic algorithms, and graph models. Heavy math runs in Rust (SIMD on CPU, CUDA optional).
- Tensors & autograd
- Training loops
- k-means & trees
- GCN / GraphSAGE
Niao Visualization
ML & Data
nvis draws charts without pulling in a browser or GUI toolkit. Plot a loss curve during training, dump a histogram while exploring a dataset, or save an SVG for a report.
There's also ASCII rendering if you just want a quick visual in the terminal or CI log. It knows how to read nml training history, so you don't have to wire that up yourself.
Import
import "nvis" |
Quick start
import "nvis" |
|
let fig = nvis.line([0.9, 0.85, 0.82, 0.80], { title: "val loss" }) |
nvis.save_svg(fig, "loss.svg") |
High-level overview of what nvis is for.
Plot a sequence over steps (training loss) or x/y pairs. Axes, titles, and colors are configurable.
See how a column is distributed, or visualize a 2D matrix (correlations, confusion counts, etc.).
Write vector output to a file, scales cleanly in docs and slides.
Pass an nml Trainer history object and get train/val loss on one figure.
Render a rough chart in the terminal when you don't want to open a file.
8 functions and methods in nvis. Grouped by category from the standard library docs.
| Signature | Description |
|---|---|
| nvis_line(data) | Line chart from `FloatArray` or numeric array |
| nvis_hist(data, bins) | Histogram |
| nvis_scatter(x, y) | Scatter plot |
| nvis_heatmap(data, rows, cols) | 2D heatmap |
| nvis_bar(values) | Bar chart |
| Signature | Description |
|---|---|
| nvis_print_ascii(chart) | Print chart as ASCII in the terminal |
| nvis_save_svg(chart, path) | Export chart to SVG file |
| nvis_to_csv(chart) | Export chart data as CSV string |
More from ML & Data.
Niao Machine Learning
Machine learning in Niao: tensors, training loops, classic algorithms, and graph models. Heavy math runs in Rust (SIMD on CPU, CUDA optional).
Niao Column Library
Columnar data like pandas: typed columns, DataFrames, groupby, merges, and CSV I/O. Kernels are vectorized in Rust.