3 unstable releases

0.5.0 Nov 21, 2021
0.4.2 Jun 11, 2020
0.4.1 Jun 12, 2017

#7 in #coaster

33 downloads per month
Used in juice

MIT/Apache

205KB
4.5K SLoC

coaster-NN • Join the chat at https://gitter.im/spearow/juice Build Status Crates.io dependency status License

coaster-NN provides Neural Network related algorithms for coaster. Run NN operations on servers, desktops or mobiles, GPUs, FPGAs or CPUS, without carrying about OpenCL or CUDA support on the machine.

It powers Juice.

For more information,

  • see coaster-NN's Documentation
  • visit coaster for more information about portable operations and other Plugins.
  • or get in touch on Gitter

Provided Operations

This Plugins provides the following operations to the coaster Backend. Every Operation includes forward + backward. A - means not yet implemented. More information can be found in the Documentation.

Operation CUDA OpenCL Native
Sigmoid cuDNN v5 or later - Rust
SigmoidPointwise cuDNN v5 or later - Rust
ReLU cuDNN v5 or later - Rust
ReLUPointwise cuDNN v5 or later - Rust
Tanh cuDNN v5 or later - Rust
TanhPointwise cuDNN v5 or later - Rust
Normalization (LRN) cuDNN v5 or later - -
Convolution cuDNN v5 or later - Rust(forward)
Softmax cuDNN v5 or later - Rust
LogSoftmax cuDNN v5 or later - Rust
Pooling Max cuDNN v5 or later - Rust(forward)
Pooling Avg cuDNN v5 or later - -

Kudos to ehiggs, for implementing the initial native Rust operations.

Getting Started

If you're using Cargo, just add coaster-NN to your Cargo.toml:

[dependencies]
coaster = "0.2"
coaster-nn = "0.4"

If you're using Cargo Edit, you can call:

$ cargo add coaster-nn

Usage

Bring the Plugin trait and the other important coaster traits/structs in scope and you will be able to execute the here provided operations on your coaster Backend.

extern crate coaster as co;
extern crate coaster_nn as nn;
use co::prelude::*;
use nn::*;
fn main() {
    // Initialize a CUDA Backend.
    let backend = Backend::<Cuda>::default().unwrap();
    // Initialize two SharedTensors.
    // Usually you would want also fill them with data.
    // More infos about that in the coaster README.md
    let mut x = SharedTensor::<f32>::new(backend.device(), &(1, 1, 3)).unwrap();
    let mut result = SharedTensor::<f32>::new(backend.device(), &(1, 1, 3)).unwrap();
    // Use the operation provided by this Plugin.
    backend.sigmoid(&mut x, &mut result);
}

Contributing

Want to contribute? Awesome! We have instructions to help you get started contributing code or documentation. And high priority issues, that we could need your help with.

We have a mostly real-time collaboration culture and happens here on Github and on the Gitter Channel. You can also reach out to the Maintainer(s) {drahnr}.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

Changelog

A changelog is a log or record of all the changes made to a project, such as a website or software project, usually including such records as bug fixes, new features, etc. - Wikipedia

You can find the release history at the CHANGELOG file.

We are using Clog, the Rust tool for auto generating CHANGELOG files.

License

Licensed under either of

at your option.

Dependencies

~1.2–2MB
~45K SLoC