1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Neurox — minimalist numerical and ML building blocks in Rust.
//!
//! This crate provides:
//! - A `Tensor` type for numeric data (row-major)
//! - Core tensor ops (matrix multiplication, element-wise add/mul, broadcasting)
//! - Activation functions (ReLU, Sigmoid, Tanh, Softmax)
//! - A `Dense` layer with backprop and cached activations
//! - A sequential `Model` with forward pass and training via SGD/Adam
//! - Losses (MSE, Cross-Entropy), data utilities, and error types
//!
//! All operations currently run on CPU and are designed for clarity and extensibility.
//!
//! Example: small MLP with ReLU
//! ```ignore
//! use neurox::{Model, Tensor, Activation};
//!
//! // 3 -> 4 -> 2 MLP
//! let mut model = Model::new(&[3, 4, 2], Activation::ReLU);
//!
//! // batch of 8 samples with 3 features
//! let x = Tensor::random(8, 3);
//! let logits = model.forward(&x).unwrap();
//! let probs = neurox::activations::softmax(&logits);
//! println!("probs: {:?}", probs);
//! ```
// Convenient re-exports for common types and errors
pub use crate::;
pub use crate;
pub use crate;
pub use crate;
/// Prelude with the most commonly used items.