axonml_train/lib.rs
1//! Axonml Train — High-Level Training Infrastructure
2//!
3//! # File
4//! `crates/axonml-train/src/lib.rs`
5//!
6//! # Author
7//! Andrew Jewell Sr. — AutomataNexus LLC
8//! ORCID: 0009-0005-2158-7060
9//!
10//! # Updated
11//! April 14, 2026 11:15 PM EST
12//!
13//! # Overview
14//!
15//! Training utilities split out of the `axonml` umbrella crate:
16//!
17//! | Module | Purpose |
18//! |--------|---------|
19//! | [`trainer`] | `TrainingConfig`, `Callback`, `EarlyStopping`, `ProgressLogger`, `TrainingHistory`, `TrainingMetrics`, `clip_grad_norm` |
20//! | [`hub`] | Unified model hub / registry (`UnifiedModelInfo`, `BenchmarkResult`, `ModelCategory`) — requires `vision` + `llm` features for full catalog |
21//! | [`benchmark`] | `benchmark_model`, `throughput_test`, `profile_model_memory`, `compare_models` |
22//! | [`adversarial`] | `AdversarialTrainer`, `fgsm_attack`, `pgd_attack` |
23//!
24//! The **live browser training monitor** stays in the `axonml` umbrella crate
25//! (see `axonml::monitor::TrainingMonitor`).
26//!
27//! # Feature Flags
28//!
29//! - `vision` — include `axonml-vision` models in the hub registry
30//! - `llm` — include `axonml-llm` models in the hub registry
31//! - `full` — both `vision` + `llm`
32//! - `cuda` — GPU acceleration
33//!
34//! # Disclaimer
35//! Use at own risk. This software is provided "as is", without warranty of any
36//! kind, express or implied. The author and AutomataNexus shall not be held
37//! liable for any damages arising from the use of this software.
38
39#![warn(clippy::all)]
40#![allow(clippy::cast_possible_truncation)]
41#![allow(clippy::cast_sign_loss)]
42#![allow(clippy::cast_precision_loss)]
43#![allow(clippy::missing_errors_doc)]
44#![allow(clippy::missing_panics_doc)]
45#![allow(clippy::must_use_candidate)]
46#![allow(clippy::module_name_repetitions)]
47#![allow(clippy::too_many_arguments)]
48#![allow(clippy::too_many_lines)]
49#![allow(clippy::similar_names)]
50#![allow(clippy::needless_pass_by_value)]
51#![allow(clippy::unreadable_literal)]
52#![allow(clippy::doc_markdown)]
53
54// =============================================================================
55// Training Utilities
56// =============================================================================
57
58pub mod trainer;
59pub use trainer::{
60 Callback, EarlyStopping, ProgressLogger, TrainingConfig, TrainingHistory, TrainingMetrics,
61 TrainingState, clip_grad_norm, compute_accuracy,
62};
63
64// =============================================================================
65// Model Hub
66// =============================================================================
67
68pub mod hub;
69pub use hub::{BenchmarkResult, ModelCategory, UnifiedModelInfo};
70
71#[cfg(all(feature = "vision", feature = "llm"))]
72pub use hub::{
73 compare_benchmarks, list_all_models, models_by_category, models_by_max_params,
74 models_by_max_size_mb, recommended_models, search_models,
75};
76
77// =============================================================================
78// Benchmarking
79// =============================================================================
80
81pub mod benchmark;
82pub use benchmark::{
83 MemorySnapshot, ThroughputConfig, ThroughputResult, benchmark_model, benchmark_model_named,
84 compare_models, print_memory_profile, print_throughput_results, profile_model_memory,
85 throughput_test, warmup_model,
86};
87
88// =============================================================================
89// Adversarial Training
90// =============================================================================
91
92pub mod adversarial;
93pub use adversarial::{AdversarialTrainer, adversarial_training_step, fgsm_attack, pgd_attack};