feat(training): add burn MLP and CART tree trainers with weight export

Behind the `training` feature flag (burn 0.20 + ndarray + autodiff).
Trains a single-hidden-layer MLP with Adam optimizer and weighted BCE
loss, plus a CART decision tree using Gini impurity. Exports trained
weights as Rust const arrays that compile directly into the binary.

Signed-off-by: Sienna Meridian Satterwhite <sienna@sunbeam.pt>
This commit is contained in:
2026-03-10 23:38:21 +00:00
parent a9f1fd83bd
commit 067d822244
8 changed files with 6103 additions and 77 deletions

View File

@@ -77,6 +77,17 @@ iroh-gossip = { version = "0.96", features = ["net"] }
blake3 = "1"
hex = "0.4"
rand = "0.9"
rayon = "1"
tempfile = "3"
# Dataset ingestion (CIC-IDS2017 CSV parsing)
csv = "1"
# burn-rs ML framework (training only, behind `training` feature)
burn = { version = "0.20", features = ["ndarray", "autodiff"], optional = true }
[features]
training = ["burn"]
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
@@ -87,6 +98,10 @@ tempfile = "3"
name = "scanner_bench"
harness = false
[[bench]]
name = "ddos_bench"
harness = false
[profile.release]
opt-level = 3
lto = true