Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gen1321/yetantotherrubynerualnetwork
https://github.com/gen1321/yetantotherrubynerualnetwork
machine-learning neural-network ruby
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/gen1321/yetantotherrubynerualnetwork
- Owner: gen1321
- Created: 2017-06-28T15:24:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-01T10:42:21.000Z (over 7 years ago)
- Last Synced: 2024-11-12T16:47:10.077Z (3 months ago)
- Topics: machine-learning, neural-network, ruby
- Language: Ruby
- Size: 681 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yet another Nerual Network With Ruby
Hey! this is nerual network is build for educational purposes. It easy to read and understand but it's kinda slow.
This Neraual network have very simple syntax
First of all you need to initialize Network
```
Net.new([80], 28 * 28, %w[0 1 2 3 4 5 6 7 8 9])
```First argument is shape of hiden layers. each element of array is represents layer of network. [10] is one layer with 10 neurons, [10, 10] is 2 layer with 10 neurons each
Second argument is size of input layer. it should be equal to your input size.
Thrid argument is shape of output. if we want our network to classify digits we should pass %w[0 1 2 3 4 5 6 7 8 9]. when you call process it will return something like ['1' => 0.2, '2' => 0.8 ..]
```
process([0,0,0,1,2,3,4])
```
takes array of digits that represents your input
and return hash of `'label' => probablity````
train(array_of_inputs, array_of_expected_results)
```
example `train([[0,0,0,1,2,3,4], [0,0,0,2,2,3,3]], [[0,1], [1,0]])`## MNIST
in example folder you can find HelloWorld of Neraual Networks, OCR on handwriten digits with MNIST dataset.
with this implementation i managed to get around 60-70% of success. Dont forget to put dataset to examples folder