https://github.com/gbuesing/neural-net-ruby
A neural network, written in Ruby
https://github.com/gbuesing/neural-net-ruby
neural-network rprop ruby rubyml
Last synced: 6 months ago
JSON representation
A neural network, written in Ruby
- Host: GitHub
- URL: https://github.com/gbuesing/neural-net-ruby
- Owner: gbuesing
- Created: 2014-11-04T19:40:53.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-02T12:13:00.000Z (over 8 years ago)
- Last Synced: 2025-06-01T15:51:41.032Z (7 months ago)
- Topics: neural-network, rprop, ruby, rubyml
- Language: Ruby
- Size: 45.9 KB
- Stars: 127
- Watchers: 7
- Forks: 15
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- machine-learning-with-ruby - neural-net-ruby - (Machine Learning Libraries / Neural networks)
README
Neural Net (in Ruby)
===
A [feedforward neural network](http://en.wikipedia.org/wiki/Feedforward_neural_network) with [resilient backpropagation](http://en.wikipedia.org/wiki/Rprop) (Rprop). It's ~250 loc, 100% Ruby, with no external dependencies.
This implementation trains significantly faster than [ai4r](https://github.com/SergioFierens/ai4r)'s backpropagation neural network, mainly because the Rprop training algorithm implemented here is much faster than the non-batch backpropagation algorithm used in ai4r.
However, this implementation is significantly slower than [ruby-fann](https://github.com/tangledpath/ruby-fann), which wraps the FANN library, written in C. If you're looking for something production-ready, check out ruby-fann.
Examples
---
- ```iris.rb```: solves a simple classification problem: predict the species of iris flower based on sepal and petal size.
- ```mpg.rb```: solves a simple regression problem: predict the miles per gallon of a car based on car attributes.
- ```mnist.rb```: performs OCR on handwritten digits. Requires download of MNIST dataset; see instructions at top of file.
Sources and inspirations
---
- [Introduction to the Math of Neural Networks](http://www.amazon.com/Introduction-Math-Neural-Networks-Heaton-ebook/dp/B00845UQL6)
- [Neural Networks and Deep Learning](http://neuralnetworksanddeeplearning.com/)
- [Thoughtful Machine Learning: A Test-Driven Approach](http://www.amazon.com/Thoughtful-Machine-Learning-Test-Driven-Approach/dp/1449374069)
- [Hacker's guide to Neural Networks](http://karpathy.github.io/neuralnets/)
- [https://github.com/harthur/brain](https://github.com/harthur/brain)
- [The RPROP Algorithm](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.21.1417&rep=rep1&type=pdf)
- [Resources for Machine Learning in Ruby](https://gist.github.com/gbuesing/865b814d312f46775cda)
License
---
MIT