MCPcopy Index your code
hub / github.com/autumnai/leaf

github.com/autumnai/leaf @0.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.1 ↗ · + Follow
403 symbols 880 edges 36 files 181 documented · 45%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Leaf • Join the chat at https://gitter.im/autumnai/leaf Build Status Crates.io License

Introduction

Leaf is a open Machine Learning Framework for hackers to build classical, deep or hybrid machine learning applications. It was inspired by the brilliant people behind TensorFlow, Torch, Caffe, Rust and numerous research papers and brings modularity, performance and portability to deep learning.

Leaf has one of the simplest APIs, is lean and tries to introduce minimal technical debt to your stack.

See the Leaf - Machine Learning for Hackers book for more.

Leaf is a few months old, but thanks to its architecture and Rust, it is already one of the fastest Machine Intelligence Frameworks available.

See more Deep Neural Networks benchmarks on Deep Learning Benchmarks.

Leaf is portable. Run it on CPUs, GPUs, and FPGAs, on machines with an OS, or on machines without one. Run it with OpenCL or CUDA. Credit goes to Collenchyma and Rust.

Leaf is part of the Autumn Machine Intelligence Platform, which is working on making AI algorithms 100x more computational efficient.

We see Leaf as the core of constructing high-performance machine intelligence applications. Leaf's design makes it easy to publish independent modules to make e.g. deep reinforcement learning, visualization and monitoring, network distribution, automated preprocessing or scaleable production deployment easily accessible for everyone.

Disclaimer: Leaf is currently in an early stage of development. If you are experiencing any bugs with features that have been implemented, feel free to create a issue.

Getting Started

Documentation

To learn how to build classical, deep or hybrid machine learning applications with Leaf, check out the Leaf - Machine Learning for Hackers book.

For additional information see the Rust API Documentation or the Autumn Website.

Or start by running the Leaf examples.

We are providing a Leaf examples repository, where we and others publish executable machine learning models build with Leaf. It features a CLI for easy usage and has a detailed guide in the project README.md.

Leaf comes with an examples directory as well, which features popular neural networks (e.g. Alexnet, Overfeat, VGG). To run them on your machine, just follow the install guide, clone this repoistory and then run

# The examples currently require CUDA support.
cargo run --release --no-default-features --features cuda --example benchmarks alexnet

Installation

Leaf is build in Rust. If you are new to Rust you can install Rust as detailed here. We also recommend taking a look at the official Rust - Getting Started Guide.

To start building a machine learning application (Rust only for now. Wrappers are welcome) and you are using Cargo, just add Leaf to your Cargo.toml:

[dependencies]
leaf = "0.2.1"

If you are on a machine that doesn't have support for CUDA or OpenCL you can selectively enable them like this in your Cargo.toml:

[dependencies]
leaf = { version = "0.2.1", default-features = false }

[features]
default = ["native"] # include only the ones you want to use, in this case "native"
native  = ["leaf/native"]
cuda    = ["leaf/cuda"]
opencl  = ["leaf/opencl"]

More information on the use of feature flags in Leaf can be found in FEATURE-FLAGS.md

Contributing

If you want to start hacking on Leaf (e.g. adding a new Layer) you should start with forking and cloning the repository.

We have more instructions to help you get started in the CONTRIBUTING.md.

We also has a near real-time collaboration culture, which happens here on Github and on the Leaf Gitter Channel.

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.

Ecosystem / Extensions

We designed Leaf and the other crates of the Autumn Platform to be as modular and extensible as possible. More helpful crates you can use with Leaf:

  • Cuticula: Preprocessing Framework for Machine Learning
  • Collenchyma: Portable, HPC-Framework on any hardware with CUDA, OpenCL, Rust

Support / Contact

  • With a bit of luck, you can find us online on the #rust-machine-learning IRC at irc.mozilla.org,
  • but we are always approachable on Gitter/Leaf
  • For bugs and feature request, you can create a Github issue
  • For more private matters, send us email straight to our inbox: developers@autumnai.com
  • Refer to Autumn for more information

Changelog

You can find the release history at the CHANGELOG.md. We are using Clog, the Rust tool for auto-generating CHANGELOG files.

License

Licensed under either of

  • Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Extension points exported contracts — how you extend this code

ILayer (Interface)
A Layer in a Neural Network that can handle forward and backward of a computation step. [14 implementers]
src/layer.rs
CapnpWrite (Interface)
Provides functionality for Cap'n Proto (de)serialization. [10 implementers]
src/capnp_util.rs
FilterLayer (Interface)
Provides common utilities for Layers that utilize a filter with stride and padding. This is used by the Convolution and [2 …
src/layers/common/mod.rs
Axpby (Interface)
Extends IBlas with Axpby [1 implementers]
src/util.rs
ISolver (Interface)
Implementation of a specific Solver. See [Solvers][1] [1]: ../solvers/index.html
src/solver/mod.rs
SGDSolver (Interface)
(no doc) [1 implementers]
src/solvers/mod.rs
ComputeOutput (Interface)
A Layer that can compute the output for a given input. [14 implementers]
src/layer.rs
CapnpRead (Interface)
(no doc) [9 implementers]
src/capnp_util.rs

Core symbols most depended-on inside this repo

add_layer
called by 98
src/layers/container/sequential.rs
add_input
called by 46
src/layer.rs
n
called by 43
doc/book/jquery.js
$
called by 40
doc/book/jquery.js
add_output
called by 37
src/layer.rs
oa
called by 21
doc/book/jquery.js
sync
called by 19
src/layer.rs
n
called by 17
doc/book/highlight.js

Shape

Method 230
Function 126
Class 27
Interface 12
Enum 8

Languages

Rust79%
TypeScript21%

Modules by API surface

src/layer.rs77 symbols
doc/book/jquery.js64 symbols
src/layers/container/sequential.rs30 symbols
src/solver/mod.rs23 symbols
src/layers/common/convolution.rs20 symbols
doc/book/highlight.js20 symbols
src/layers/common/pooling.rs17 symbols
src/layers/common/linear.rs16 symbols
src/solver/confusion_matrix.rs13 symbols
src/layers/loss/negative_log_likelihood.rs13 symbols
src/weight.rs12 symbols
src/layers/utility/reshape.rs12 symbols

For agents

$ claude mcp add leaf \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact