Nabla-ML
Nabla-ML is a Rust library inspired by NumPy, providing a multi-dimensional array implementation with various mathematical and array manipulation functionalities.
Features
- Array Creation: Create 1D and 2D arrays using vectors and matrices.
- Random Arrays: Generate arrays with random numbers, including uniform and normal distributions.
- Arithmetic Operations: Perform element-wise addition, subtraction, multiplication, and division.
- Mathematical Functions: Apply functions like square root, exponential, sine, cosine, logarithm, hyperbolic tangent, ReLU, Leaky ReLU, and Sigmoid to arrays.
- Array Reshaping: Change the shape of arrays while maintaining data integrity.
- File I/O: Save and load arrays in a compressed format.
- Linear Regression: Perform linear regression using gradient descent.
- MNIST Dataset Handling: Convert and load MNIST data for machine learning tasks.
Getting Started
Installation
Add the following to your Cargo.toml:
[]
= "0.2.0"
Usage
Array Creation
use NDArray;
let arr = from_vec;
let matrix = from_matrix;
Random Arrays
use NDArray;
let random_array = randn;
let random_matrix = randn_2d;
Mathematical Functions
use NDArray;
let arr = from_vec;
let sqrt_arr = arr.sqrt;
let exp_arr = arr.exp;
let tanh_arr = arr.tanh;
let relu_arr = arr.relu;
let leaky_relu_arr = arr.leaky_relu;
let sigmoid_arr = arr.sigmoid;
File I/O with .nab Format
use ;
let array = from_vec;
save_nab.expect;
let loaded_array = load_nab.expect;
assert_eq!;
assert_eq!;
Linear Regression
use NDArray;
let X = from_matrix;
let y = from_vec;
let = linear_regression;
println!;
MNIST Dataset Handling
use NDArray;
mnist_csv_to_nab.expect;
let =
load_and_split_dataset.expect;

License
This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.