Crates.io | wasm-nn |
lib.rs | wasm-nn |
version | 0.1.0 |
source | src |
created_at | 2022-12-17 18:42:46.565047 |
updated_at | 2022-12-17 18:42:46.565047 |
description | wasm-nn is a deep learning framework for WebAssembly. |
homepage | |
repository | https://github.com/0xArty/wasm-nn |
max_upload_size | |
id | 740001 |
size | 10,691 |
wasm-nn is a deep learning framework for WebAssembly (Wasm) that allows you to train and deploy neural networks in the browser or on the server. It has Python bindings that are compatible with PyTorch, so you can use your existing PyTorch code and models with wasm-nn.
To install wasm-nn, you need to have Rust and wasm-pack installed on your system. Then, you can install wasm-nn with the following command:
wasm-pack install wasm-nn
[dependencies]
wasm-nn = "0.1.0"
Then, you can use it in your Rust code like this:
extern crate wasm_nn;
use wasm_nn::tensor::Tensor;
use wasm_nn::optim::SGD;
use wasm_nn::nn::{Module, Linear};
fn main() {
let mut model = Linear::new(2, 3);
let optimizer = SGD::default();
// Train the model on some data...
}
To use wasm-nn with Python, you can install the Python package with pip:
pip install wasm-nn
Then, you can use it in your Python code like this:
import wasm_nn
model = wasm_nn.Linear(2, 3)
optimizer = wasm_nn.SGD()
# Train the model on some data...
For more details on how to use wasm-nn, see the API documentation.
We welcome contributions to wasm-nn! If you'd like to contribute, please read our contribution guidelines and open a pull request.
wasm-nn is licensed under the MIT License.
wasm-nn is built on top of the WasmBindgen project, which makes it easy to interface between Rust and JavaScript. We are grateful to the WasmBindgen team and community for their efforts in making Wasm development a pleasure.