├── .clog.toml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cargo.toml ├── FEATURE-FLAGS.md ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── RELEASE.md ├── benches └── network_benches.rs ├── build.rs ├── capnp └── leaf.capnp ├── doc ├── book │ ├── _FontAwesome │ │ ├── css │ │ │ └── font-awesome.css │ │ └── fonts │ │ │ ├── FontAwesome.ttf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ ├── fontawesome-webfont.woff │ │ │ └── fontawesome-webfont.woff2 │ ├── backend.html │ ├── book.css │ ├── book.js │ ├── building-networks.html │ ├── create-new-layer.html │ ├── deep-learning-glossary.html │ ├── distributed-optimization.html │ ├── favicon.png │ ├── highlight.css │ ├── highlight.js │ ├── http: │ │ └── autumnai.github.io │ │ │ └── leaf │ │ │ └── leaf │ │ │ └── index.html │ ├── index.html │ ├── jquery.js │ ├── layer-lifecycle.html │ ├── layers.html │ ├── leaf.html │ ├── multi-device-optimization.html │ ├── optimize-layers.html │ ├── print.html │ ├── solvers.html │ └── tomorrow-night.css └── src │ ├── SUMMARY.md │ ├── backend.md │ ├── building-networks.md │ ├── create-new-layer.md │ ├── deep-learning-glossary.md │ ├── distributed-optimization.md │ ├── http: │ └── autumnai.github.io │ │ └── leaf │ │ └── leaf │ │ └── index.html │ ├── layer-lifecycle.md │ ├── layers.md │ ├── leaf.md │ ├── multi-device-optimization.md │ ├── optimize-layers.md │ └── solvers.md ├── examples └── benchmarks.rs ├── perf ├── README.md └── run_perf.sh ├── rustfmt.toml ├── src ├── capnp_util.rs ├── layer.rs ├── layers │ ├── activation │ │ ├── mod.rs │ │ ├── relu.rs │ │ ├── sigmoid.rs │ │ └── tanh.rs │ ├── common │ │ ├── convolution.rs │ │ ├── linear.rs │ │ ├── log_softmax.rs │ │ ├── mod.rs │ │ ├── pooling.rs │ │ └── softmax.rs │ ├── container │ │ ├── mod.rs │ │ └── sequential.rs │ ├── loss │ │ ├── mod.rs │ │ └── negative_log_likelihood.rs │ ├── mod.rs │ └── utility │ │ ├── flatten.rs │ │ ├── mod.rs │ │ └── reshape.rs ├── lib.rs ├── solver │ ├── confusion_matrix.rs │ └── mod.rs ├── solvers │ ├── mod.rs │ └── sgd │ │ ├── mod.rs │ │ └── momentum.rs ├── util.rs └── weight.rs └── tests ├── layer_specs.rs └── solver_specs.rs /.clog.toml: -------------------------------------------------------------------------------- 1 | [clog] 2 | # A repository link with the trailing '.git' which will be used to generate 3 | # all commit and issue links 4 | repository = "https://github.com/autumnai/leaf" 5 | 6 | # specify the style of commit links to generate, defaults to "github" if omitted 7 | link-style = "github" 8 | 9 | # The preferred way to set a constant changelog. This file will be read for old changelog 10 | # data, then prepended to for new changelog data. It's the equivilant to setting 11 | # both infile and outfile to the same file. 12 | # 13 | # Do not use with outfile or infile fields! 14 | # 15 | # Defaults to stdout when omitted 16 | # changelog = "CHANGELOG.md" 17 | 18 | # This sets the output format. There are two options "json" or "markdown" and 19 | # defaults to "markdown" when omitted 20 | output-format = "markdown" 21 | 22 | # If you use tags, you can set the following if you wish to only pick 23 | # up changes since your latest tag 24 | from-latest-tag = true 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | Cargo.lock 3 | 4 | mynetwork 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: rust 3 | rust: 4 | - nightly 5 | - beta 6 | - stable 7 | matrix: 8 | allow_failures: 9 | - rust: nightly 10 | env: FEATURES=lint 11 | exclude: 12 | - rust: beta 13 | env: FEATURES=lint 14 | - rust: stable 15 | env: FEATURES=lint 16 | branches: 17 | only: 18 | - master 19 | before_script: 20 | - | 21 | pip install 'travis-cargo<0.2' --user && 22 | export PATH=$HOME/.local/bin:$PATH 23 | script: 24 | - | 25 | travis-cargo build -- --no-default-features --features $FEATURES && 26 | travis-cargo test -- --no-default-features --features $FEATURES && 27 | travis-cargo bench -- --no-default-features --features $FEATURES && 28 | travis-cargo --only stable doc -- --no-default-features --features $FEATURES 29 | addons: 30 | apt: 31 | sources: 32 | - ubuntu-toolchain-r-test 33 | packages: 34 | - libcurl4-openssl-dev 35 | - libelf-dev 36 | - libdw-dev 37 | - libblas-dev 38 | - fglrx 39 | - opencl-headers 40 | - binutils-dev 41 | - nvidia-opencl-dev 42 | - gcc-4.8 43 | - g++-4.8 44 | install: 45 | - git clone https://github.com/kentonv/capnproto.git 46 | - cd capnproto/c++ 47 | - git checkout tags/v0.5.3 48 | - ./setup-autotools.sh 49 | - autoreconf -i 50 | - ./configure --disable-shared 51 | - make -j5 52 | - export PATH="$PATH:$(pwd)" 53 | - export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(pwd)" 54 | - cd ../.. 55 | after_success: 56 | - travis-cargo doc-upload 57 | - travis-cargo coveralls --no-sudo --verify 58 | notifications: 59 | email: 60 | on_success: never 61 | env: 62 | global: 63 | - CC=gcc-4.8 64 | - CXX=g++-4.8 65 | - secure: QcJ9u0BrVpvjYnerd/3dukvM+GLFQNikIoDHhtKjVenuM2ozZtW6+/RyyXVC1YMh/SghwTnu4Kcnv1sdmwuiC5KWdPoppfalXdxafPkl5PGEfTOexe6L5UAJNW6BdA4lbRKM3xnaUg0Guq6x6tD/zdABIkh8nym/gRLGKT40e9Xitkf6wUQqPBHTGZimip59qg5Fty8lAD48pCBEXynJm+ihA2tz6EDhp0/7wvieHyEl/FqNwvUL5+Z9EeTzEJfKNF8PA5DTHkgeXgeCnWKLm8cCdPEziRZlgdQtvIW27oZBkNTQGHyqI9/tVYhaW4AeKstzE5BoJuyRzmerWYRQCNiz8bgyAjc5HnpWLJPmPSFaGBWTRzwYwUk/iOUP4YEZiN3p0Xj1sKgSB0TA2AjKWND7cufwjrW8NdPdZ3hURVOnM8DHYSQMm2HOfbUNnkw+P5M8n+flT2HKWFdnPhJ3n12rDlLYdHeg9PQ3emJ6kE8Y/jrNT+6yZRrSwLQnsV0uU8Ii44MFQHpdUOGuOIxZFGh9rjKsUwhruUpGtbwI4FWPOqiQJvIaBFY1IUjIVlVCZevvIG3fPXvPksIEKwK93hM/ThDi2PLq2qwBpA87RNfKxDG4S0aR2j19IG+ludbpPcP95mYFVnGCb4rpj44iZoCifC8c9tVqC4L85hEGzik= 66 | matrix: 67 | - FEATURES=travis 68 | - FEATURES=lint 69 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Leaf 2 | 3 | We love, that you are interested in contributing to Leaf. There are many ways 4 | to contribute and we appreciate all of them. This document gives a rough 5 | overview of how you can contribute to Leaf. 6 | 7 | * [Pull Requests](#pull-requests) 8 | * [Bug Reports](#bug-reports) 9 | * [Feature Requests](#feature-requests) 10 | * [Appendix](#appendix) 11 | * [Git Commit Guidelines](#git-commit-guidelines) 12 | * [Documentation Guidelines](#documentation-guidelines) 13 | 14 | 15 | If you have questions hop on the [Leaf Chat](https://gitter.im/autumnai/leaf), to the #rust-machine-learning IRC on irc.mozilla.org or reach out to {@[MJ](https://twitter.com/mjhirn), @[Max](https://twitter.com/hobofan)}. 16 | 17 | ## Pull Requests 18 | 19 | #### Preparation 20 | 21 | Before you get started, please find the page of the project you're looking to 22 | improve. We encourage you to poke around in the code a little bit, familiarize 23 | yourself with their development styles, check the commit log to see who is 24 | contributing. 25 | 26 | Before you start working, you might check out the **Network** tab on the project 27 | to see all the other forks other people have made. Somebody might be already 28 | working on the problem you would love to solve. 29 | 30 | #### Making a PR 31 | 32 | Pull requests are the primary mechanism we use to change Leaf repos. GitHub 33 | itself has some [great documentation](https://help.github.com/articles/using-pull-requests/) 34 | on using the Pull Request feature. We use the 'fork and pull' model described 35 | there. 36 | 37 | Please make pull requests against the `master` branch. 38 | 39 | All pull requests are reviewed by another person. 40 | 41 | > **Highfive not yet integrated**: 42 | > *We have a bot, @rust-highfive, that will automatically assign a random* 43 | > *person to review your request.* 44 | > 45 | > *If you want to request that a specific person reviews your pull request,* 46 | > *you can add an `r?` to the message. For example, MJ usually reviews* 47 | > *documentation changes. So if you were to make a documentation change, add* 48 | > 49 | > r? @MichaelHirn 50 | > 51 | > *to the end of the message, and @rust-highfive will assign @MichaelHirn* 52 | > *instead of a random person. This is entirely optional.* 53 | 54 | After someone has reviewed your pull request, they will leave an annotation 55 | on the pull request with an `r+`. It will look something like this: 56 | 57 | @homu: r+ 38fe8d2 58 | 59 | This tells @homu, our lovable integration bot, that your pull request has 60 | been approved. The PR then enters the 61 | [merge queue](http://buildbot.rust-lang.org/homu/queue/rust), where 62 | @homu will run all the tests on every platform we support. If it all works 63 | out, @homu will merge your code into `master` and close the pull request. 64 | 65 | ## Bug Reports 66 | 67 | While bugs are unfortunate, they're a reality in software. We can't fix what we 68 | don't know about, so please report liberally. If you're not sure if something 69 | is a bug or not, feel free to file a bug anyway. 70 | 71 | If you have the chance, before reporting a bug, please search existing issues, 72 | as it's possible that someone else has already reported your error. This doesn't 73 | always work, and sometimes it's hard to know what to search for, so consider this 74 | extra credit. We won't mind if you accidentally file a duplicate report. 75 | 76 | [Opening an issue is easy](https://guides.github.com/features/issues/) 77 | Here's a template that you can use to file a bug, though it's not necessary to 78 | use it exactly: 79 | 80 | 81 | 82 | I tried this code: 83 | 84 | 85 | 86 | I expected to see this happen: 87 | 88 | Instead, this happened: 89 | 90 | ## Meta 91 | 92 | {Library, Rust, OS} versions 93 | 94 | Backtrace: 95 | 96 | All three components are important: what you did, what you expected, what 97 | happened instead. Please include information about what platform you're on, what 98 | version of Rust and library you're using, etc. 99 | 100 | Sometimes, a backtrace is helpful, and so including that is nice. To get 101 | a backtrace, set the `RUST_BACKTRACE` environment variable. The easiest way 102 | to do this is to invoke `rustc` like this: 103 | 104 | ```bash 105 | $ RUST_BACKTRACE=1 rustc ... 106 | ``` 107 | 108 | ## Feature Requests 109 | 110 | To request a change to the way that one of the Leaf libraries work, please 111 | open an issue in the repository. 112 | 113 | ## Appendix 114 | 115 | ### Git Commit Guidelines 116 | 117 | We have very precise rules over how git commit messages should be formatted. 118 | This leads to more readable messages that are easy to follow when looking 119 | through the project history. The commit guidelines help us to auto-generate the CHANGELOG. More information about it, can be found in the [`Guide to CHANGELOG in Rust` post][2]. 120 | 121 | #### Commit Message Examples 122 | 123 | Following some valid commit message examples. A syntax explanation can be found in the following section, Commit Message Format. 124 | 125 | Example for a mature commit message. 126 | ``` 127 | docs/readme: add contact section to README.md 128 | 129 | A lot of people have asked about contact details, so I decided it would be a good idea to include our contact details in the README.md 130 | 131 | REFERENCE: #4, #63 132 | CLOSE: #52 133 | ``` 134 | 135 | Another example on how you would make the commit on the command line. 136 | ``` 137 | git commit -m 'feat/solver: add Adagrad as SGD-based solver 138 | 139 | Some more context and explanation about the commit, PR. 140 | 141 | CLOSE: #42' 142 | ``` 143 | 144 | #### Commit Message Format 145 | 146 | Each commit message consists of a header, a body and a footer. The header has a 147 | special format that includes a type, a scope and a subject: 148 | 149 | /: 150 | \n 151 | 152 | \n 153 |