https://github.com/afshinm/juggernaut
Neural Network in Rust
https://github.com/afshinm/juggernaut
neural-network nn rust
Last synced: 2 months ago
JSON representation
Neural Network in Rust
- Host: GitHub
- URL: https://github.com/afshinm/juggernaut
- Owner: afshinm
- License: gpl-3.0
- Created: 2017-04-12T20:50:19.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-05T19:18:59.000Z (over 7 years ago)
- Last Synced: 2025-03-29T11:07:16.817Z (3 months ago)
- Topics: neural-network, nn, rust
- Language: Rust
- Homepage: http://juggernaut.rs
- Size: 17.4 MB
- Stars: 251
- Watchers: 7
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Juggernaut [](https://travis-ci.org/afshinm/juggernaut) [](https://coveralls.io/github/afshinm/juggernaut?branch=master)
> Juggernaut is an experimental Neural Network written in Rust
# Demo
[Juggernaut Demo](http://juggernaut.rs/demo/)
# Example
Want to setup a simple network using Juggernaut?
This sample creates a random binary operation network with one hidden layer:
```rust
fn main() {
let dataset = vec![
Sample::new(vec![0f64, 0f64, 1f64], vec![0f64]),
Sample::new(vec![0f64, 1f64, 1f64], vec![0f64]),
Sample::new(vec![1f64, 0f64, 1f64], vec![1f64]),
Sample::new(vec![1f64, 1f64, 1f64], vec![1f64])
];
let mut test = NeuralNetwork::new();let sig_activation = Sigmoid::new();
// 1st layer = 2 neurons - 3 inputs
test.add_layer(NeuralLayer::new(2, 3, sig_activation));// 2nd layer = 1 neuron - 2 inputs
test.add_layer(NeuralLayer::new(1, 2, sig_activation));test.error(|err| {
println!("error({})", err.to_string());
});test.train(dataset, 1000, 0.1f64);
let think = test.evaluate(Sample::predict(vec![1f64, 0f64, 1f64]));println!("Evaluate [1, 0, 1] = {:?}", think.get(0, 0));
}
```
and the output of `think` is the prediction of the network after training.
# Documentation
[https://docs.rs/juggernaut](https://docs.rs/juggernaut)
# Build
To build the demo, run:
```
cargo build --example helloworld --verbose
```then to run the compiled file:
```
./target/debug/examples/helloworld
```# Test
Install Rust 1.x and run:
```
cargo test
```# Authors
- Afshin Mehrabani ([email protected])
- Addtheice https://github.com/addtheiceand [contributors](https://github.com/afshinm/juggernaut/graphs/contributors)
# FAQ
### Contributing
Fork the project and send PRs + unit tests for that specific part.
### "Juggernaut"?
Juggernaut is a Dota2 hero and I like this hero. Juggernaut is a powerful hero, when he has enough farm.
# License
GNU General Public License v3.0