├── .clog.toml ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── benches ├── relu.rs ├── sigmoid.rs ├── softmax.rs └── tanh.rs ├── perf ├── README.md ├── perf_rblas.sh └── run_perf.sh ├── rustfmt.toml ├── src ├── frameworks │ ├── cuda │ │ ├── helper.rs │ │ └── mod.rs │ ├── mod.rs │ ├── native │ │ ├── helper.rs │ │ └── mod.rs │ └── opencl.rs ├── lib.rs └── plugin.rs └── tests ├── convolution_specs.rs ├── lrn_specs.rs ├── pooling_specs.rs ├── relu_pointwise_specs.rs ├── relu_specs.rs ├── sigmoid_pointwise_specs.rs ├── sigmoid_specs.rs ├── softmax_specs.rs ├── tanh_pointwise_specs.rs └── tanh_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/collenchyma-nn" 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 | -------------------------------------------------------------------------------- /.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: TRAVIS_CARGO_NIGHTLY_FEATURE=lint 11 | exclude: 12 | - rust: beta 13 | env: TRAVIS_CARGO_NIGHTLY_FEATURE=lint 14 | - rust: stable 15 | env: TRAVIS_CARGO_NIGHTLY_FEATURE=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 | cd cudnn 26 | travis-cargo build -- --no-default-feature --features "travis"s && 27 | travis-cargo test -- --no-default-features --features "travis" 28 | travis-cargo doc -- --no-default-features --features "travis" 29 | addons: 30 | apt: 31 | packages: 32 | - libcurl4-openssl-dev 33 | - libelf-dev 34 | - libdw-dev 35 | after_success: 36 | - travis-cargo doc-upload 37 | - travis-cargo coveralls --no-sudo 38 | notifications: 39 | email: 40 | on_success: never 41 | env: 42 | global: 43 | secure: hTYDLFNmzEazAYd0eBY0HearyERReUHUSSmwGvdVBIX0Vbltvq1vKmUJAneDwzRiehL9HyrX5HV4OkbA6XNseFXXuTYjC/vbSjyN+TcXDLUWIhTMTsLEdh3h5g/XQN9lv03ovmqPDA2owoggxNosRt/10dclV9GiyYHF3ozbJOur4DIMqCi9ta9FpE9KMHsC6HSSdFgW5vTcrKsk9M2GBWzy52lAUQjm1qw1zHG2FmopbzXruaeFHIV0V2owww2FxLp6Hh592/WTX0gj6AMR1M8DfvALV5vDB+F49EWWHnC64RHGW74muQXrGPmG4nk0oUE4EzjX+XWTaRUCQ9p1nkPxFcWOCqykASOCnXNLfdDH47mqRmpjvHwvS5Ivd0FWaHPWmHbxu9CJ9zJImijHPgRpKVVmxh0BqKMG72QCUkONr4nKCW/vbCOvJgnwXpFXLLhYgqQsjaT/kqGR4VbB6PxKeI0+z8AnKE6RAzZmvN1U3Bx3kZ5xEaJCfytpXGBROTyXV4gvhyyDmdG8MnYuCPlY4Ov8LC7vWAmyp7nbE/IYtGePz6B6ec5bl9qrv9zD14FOT+MFvxqZkYaNUgImTouUG/MvH1lmSrPjqalxdmq8YTiGFgmh8vFZ2ovPbfPRl6usEMcgd8CjNuewb4Dz/XNYEmsS0C3+o3HMCNJ/YVc= 44 | matrix: 45 | - TRAVIS_CARGO_NIGHTLY_FEATURE=travis 46 | - TRAVIS_CARGO_NIGHTLY_FEATURE=lint 47 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | 2 | ## 0.3.4 (2016-03-03) 3 | 4 | 5 | #### Bug Fixes 6 | 7 | * **cuda/convolution:** workaround for 0 memory allocation ([e30b59de](https://github.com/autumnai/collenchyma-nn/commit/e30b59decfe7ca6663a42fd27e19e55fcee83552)) 8 | 9 | 10 | 11 | 12 | ## 0.3.3 (2016-03-03) 13 | 14 | 15 | #### Features 16 | 17 | * **cudnnv4:** passive support for cuDNNv4 ([0dc46301](https://github.com/autumnai/collenchyma-nn/commit/0dc463011c0ae261baee201e1b9cb540309349c5)) 18 | 19 | 20 | 21 | 22 | ## 0.3.2 (2016-03-02) 23 | 24 | 25 | #### Breaking Changes 26 | 27 | * **convolution:** change convolution functions to require workspace ([f9d40136](https://github.com/autumnai/collenchyma-nn/commit/f9d401360c54bac6a253925d90625b0a1393ea17) 28 | 29 | 30 | 31 | 32 | ## 0.3.1 (2016-02-23) 33 | 34 | 35 | #### Features 36 | 37 | * **pointwise:** add pointwise activation functions (cuDNN) ([d74821b5](https://github.com/autumnai/collenchyma-nn/commit/d74821b582056f9acd3bdb4acd98f72668d070f8)) 38 | 39 | 40 | 41 | 42 | ## 0.3.0 (2016-02-22) 43 | 44 | 45 | #### Features 46 | 47 | * **log_softmax:** add LogSoftmax operations ([86a8ae67](https://github.com/autumnai/collenchyma-nn/commit/86a8ae67727e0a5d28c901a7a32940fd7e2250f2)) 48 | * **cuda:** 49 | * share workspace between CUDA convolution operations ([7f5f3207](https://github.com/autumnai/collenchyma-nn/commit/7f5f3207873874accb7a5a16d637e2701161ac04)) 50 | * allow CUDA activations to work with 1D/2D tensors ([f4effe7d](https://github.com/autumnai/collenchyma-nn/commit/f4effe7d66d96537251d86bf24968b521a951121)) 51 | * allow CUDA softmax to work with 1-3D tensors ([f74f72b6](https://github.com/autumnai/collenchyma-nn/commit/f74f72b6207505f4c29c7c44a9748d83972e7f72)) 52 | * **nn_trait:** remove trait bounds for NN ([9ad08d9f](https://github.com/autumnai/collenchyma-nn/commit/9ad08d9f97cc382699c78c1397b52509d2e98969)) 53 | * **license:** change license to dual MIT/Apache-2.0 ([8a940690](https://github.com/autumnai/collenchyma-nn/commit/8a940690e21bae269c44b9501e956bbf066cdcc1)) 54 | 55 | #### Breaking Changes 56 | 57 | * **convolution:** implement convolutions correctly ([24b164b5](https://github.com/autumnai/collenchyma-nn/commit/24b164b55a913f522d79832308cf2e4a7996612a)) 58 | 59 | #### Performance 60 | 61 | * **convolution:** don't do a memAlloc for a zero size workspace ([73612bb5](https://github.com/autumnai/collenchyma-nn/commit/73612bb56ab70500b4670b7a9a12390e2facee37)) 62 | 63 | 64 | 65 | ## 0.2.1 (2016-01-21) 66 | 67 | 68 | #### Features 69 | 70 | * **native:** Add support for softmax w/ test and benches. ([14d6d1bc](https://github.com/autumnai/collenchyma-nn/commit/14d6d1bcda8bbc0ffa368527633f592862517200)) 71 | 72 | #### Bug Fixes 73 | 74 | * **native:** Fix sigmoid_grad to use x_diff instead of x for dx ([c25a32aa](https://github.com/autumnai/collenchyma-nn/commit/c25a32aa272ff3c753ee8be2ea89457367b38734)) 75 | 76 | 77 | 78 | 79 | ## 0.2.0 (2016-01-15) 80 | 81 | 82 | #### Features 83 | 84 | * **bench:** add bench and perf utilities ([0e2d34c6](https://github.com/autumnai/collenchyma-nn/commit/0e2d34c67acba38c6910cdff6e983b5285dfb852)) 85 | * **native:** implement Sigmoid, ReLU, tanh for Native backend. ([ece54e37](https://github.com/autumnai/collenchyma-nn/commit/ece54e37a241f81b45888225ab0ee28c538950f6)) 86 | 87 | 88 | 89 | ## 0.1.0 (2015-12-21) 90 | 91 | 92 | #### Bug Fixes 93 | 94 | * **scale_params:** fix ScalParams default to work on stable ([43654dca](https://github.com/autumnai/collenchyma-nn/commit/43654dca7cb92826ffecd4f0cd251fb7071d11c5)) 95 | 96 | #### Features 97 | 98 | * **activation:** add most popular NN activation functions ([3311bb43](https://github.com/autumnai/collenchyma-nn/commit/3311bb43d78c850db8322c9ea8c1a5f2ca189cd1)) 99 | * **features:** add framework feature groups ([08629ea8](https://github.com/autumnai/collenchyma-nn/commit/08629ea8f1c38047a5d7fec24601e21ba79d704f)) 100 | * **nn:** 101 | * add all cudnn available operations to collenchyma-nn ([03384763](https://github.com/autumnai/collenchyma-nn/commit/033847630a0674c372666db209d436a80ecabe1b)) 102 | * add basic nn implementation structure ([aa17ef0f](https://github.com/autumnai/collenchyma-nn/commit/aa17ef0f5064e479152ac3e398bf64887e03b6e2)) 103 | * **sigmoid:** 104 | * add full sigmoid CUDA implementation ([8ea1a290](https://github.com/autumnai/collenchyma-nn/commit/8ea1a29016c364536755e2fb5d13a52352b059ab)) 105 | * add CUDA Sigmoid ([6aceb957](https://github.com/autumnai/collenchyma-nn/commit/6aceb957d05a0ee625b48bab38693b99c9e09f01)) 106 | -------------------------------------------------------------------------------- /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) 16 | , or reach out to {@[MJ](https://twitter.com/mjhirn), @[Max](https://twitter.com/hobofan)}. 17 | 18 | ## Pull Requests 19 | 20 | #### Preparation 21 | 22 | Before you get started, please find the page of the project you're looking to 23 | improve. We encourage you to poke around in the code a little bit, familiarize 24 | yourself with their development styles, check the commit log to see who is 25 | contributing. 26 | 27 | Before you start working, you might check out the **Network** tab on the project 28 | to see all the other forks other people have made. Somebody might be already 29 | working on the problem you would love to solve. 30 | 31 | #### Making a PR 32 | 33 | Pull requests are the primary mechanism we use to change Leaf repos. GitHub 34 | itself has some [great documentation](https://help.github.com/articles/using-pull-requests/) 35 | on using the Pull Request feature. We use the 'fork and pull' model described 36 | there. 37 | 38 | Please make pull requests against the `master` branch. 39 | 40 | All pull requests are reviewed by another person. 41 | 42 | > **Highfive not yet integrated**: 43 | > *We have a bot, @rust-highfive, that will automatically assign a random* 44 | > *person to review your request.* 45 | > 46 | > *If you want to request that a specific person reviews your pull request,* 47 | > *you can add an `r?` to the message. For example, MJ usually reviews* 48 | > *documentation changes. So if you were to make a documentation change, add* 49 | > 50 | > r? @MichaelHirn 51 | > 52 | > *to the end of the message, and @rust-highfive will assign @MichaelHirn* 53 | > *instead of a random person. This is entirely optional.* 54 | 55 | After someone has reviewed your pull request, they will leave an annotation 56 | on the pull request with an `r+`. It will look something like this: 57 | 58 | @homu: r+ 38fe8d2 59 | 60 | This tells @homu, our lovable integration bot, that your pull request has 61 | been approved. The PR then enters the 62 | [merge queue](http://buildbot.rust-lang.org/homu/queue/rust), where 63 | @homu will run all the tests on every platform we support. If it all works 64 | out, @homu will merge your code into `master` and close the pull request. 65 | 66 | ## Bug Reports 67 | 68 | While bugs are unfortunate, they're a reality in software. We can't fix what we 69 | don't know about, so please report liberally. If you're not sure if something 70 | is a bug or not, feel free to file a bug anyway. 71 | 72 | If you have the chance, before reporting a bug, please search existing issues, 73 | as it's possible that someone else has already reported your error. This doesn't 74 | always work, and sometimes it's hard to know what to search for, so consider this 75 | extra credit. We won't mind if you accidentally file a duplicate report. 76 | 77 | [Opening an issue is easy](https://guides.github.com/features/issues/) 78 | Here's a template that you can use to file a bug, though it's not necessary to 79 | use it exactly: 80 | 81 | 82 | 83 | I tried this code: 84 | 85 | 86 | 87 | I expected to see this happen: 88 | 89 | Instead, this happened: 90 | 91 | ## Meta 92 | 93 | {Library, Rust, OS} versions 94 | 95 | Backtrace: 96 | 97 | All three components are important: what you did, what you expected, what 98 | happened instead. Please include information about what platform you're on, what 99 | version of Rust and library you're using, etc. 100 | 101 | Sometimes, a backtrace is helpful, and so including that is nice. To get 102 | a backtrace, set the `RUST_BACKTRACE` environment variable. The easiest way 103 | to do this is to invoke `rustc` like this: 104 | 105 | ```bash 106 | $ RUST_BACKTRACE=1 rustc ... 107 | ``` 108 | 109 | ## Feature Requests 110 | 111 | To request a change to the way that one of the Leaf libraries work, please 112 | open an issue in the repository. 113 | 114 | ## Appendix 115 | 116 | ### Git Commit Guidelines 117 | 118 | We have very precise rules over how git commit messages should be formatted. 119 | This leads to more readable messages that are easy to follow when looking 120 | through the project history. But also, we may use the git commit messages to 121 | auto-generate the Leaf change log. 122 | 123 | #### Commit Message Format 124 | 125 | Each commit message consists of a header, a body and a footer. The header has a 126 | special format that includes a type, a scope and a subject: 127 | 128 | /: 129 | \n 130 | 131 | \n 132 |