4 releases
Uses new Rust 2024
| 0.1.1 | Jun 30, 2025 |
|---|---|
| 0.1.0 | Apr 24, 2024 |
| 0.1.0-nightly | Apr 20, 2024 |
| 0.0.0 | Apr 13, 2024 |
#440 in Data structures
34 downloads per month
51KB
1K
SLoC
ndtensor
Warning: The library still in development and is not yet ready for production use.
Note: It is important to note that a primary consideration of the ndtensor framework is ensuring compatibility in two key areas:
autodiff: the upcoming feature enabling rust to natively support automatic differentiation.ndarray: The crate is designed around thendarraycrate, which provides a powerful N-dimensional array type for Rust
Overview
Goals
- Provide a flexible and extensible framework for building neural network models in Rust.
- Support both shallow and deep neural networks with a focus on modularity and reusability.
- Enable easy integration with other libraries and frameworks in the Rust ecosystem.
Roadmap
- v1:
-
ParamsBase: Design a basic structure for storing model parameters. - Traits: Create a set of traits for defining the basics of a neural network model.
ForwardandBackward: traits defining forward and backward propagationModel: A trait for defining a neural network model.Predict: A trait extending the basicForwardpass.Train: A trait for training a neural network model.
-
- v2:
- Models:
Trainer: A generic model trainer that can be used to train any model.
- Layers: Implement a standard model configuration and parameters.
LayerBase: functional wrappers for theParamsBasestructure.
- Models:
Usage
Adding to your project
To use ndtensor in your project, add the following to your Cargo.toml:
[dependencies.ndtensor]
features = ["full"]
version = "0.1.x"
Examples
Example (1): Basic Usage
Getting Started
Prerequisites
To use ndtensor, you need to have the following installed:
- Rust (version 1.85 or later)
Installation
You can install the rustup toolchain using the following command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
After installing rustup, you can install the latest stable version of Rust with:
rustup install stable
You can also install the latest nightly version of Rust with:
rustup install nightly
Building from the source
Start by cloning the repository
git clone https://github.com/FL03/ndtensor.git
Then, navigate to the ndtensor directory:
cd ndtensor
Using the cargo tool
To build the crate, you can use the cargo tool. The following command will build the crate with all features enabled:
cargo build -r --locked --workspace --features full
To run the tests, you can use the following command:
cargo test -r --locked --workspace --features full
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Dependencies
~2–5.5MB
~111K SLoC