https://github.com/ivan-tymoshenko/neural-network
Toy neural network
https://github.com/ivan-tymoshenko/neural-network
machine-learning ml neural-nets neural-network python
Last synced: 4 months ago
JSON representation
Toy neural network
- Host: GitHub
- URL: https://github.com/ivan-tymoshenko/neural-network
- Owner: ivan-tymoshenko
- License: mit
- Created: 2018-10-01T07:29:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-29T17:39:31.000Z (almost 7 years ago)
- Last Synced: 2025-01-07T21:17:00.597Z (over 1 year ago)
- Topics: machine-learning, ml, neural-nets, neural-network, python
- Language: Python
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backpropagation neural network
`neural-network` is a library that allows you to create and train a neural network of a given configuration.
## Create network
`create_network(layers_size)`
- `layers_size` - list of the number of neurons on each layer (starting from the input layer)
## Train network
`train(weights, test_datasets, iterations, learning_rate)`
- `weights` - network weights
- `test_datasets` - list of typles of input datasets and expected datasets
- `iterations` - number of interations
- `learning_rate` - (0, 1) neural network learning speed / accuracy
## Predict
`predict(weights, input_datasets, reliable_limit)`
- `weights` - network weights
- `input_datasets` - list of input datasets
- `reliable_limit` - (0, 0.5) limit of unknown results
Example:
```Python
train_datasets = [
([0, 0, 1], [1]),
([0, 1, 1], [0]),
([1, 0, 1], [1]),
([1, 1, 1], [1]),
([0, 0, 0], [0])
]
weights = create_weights([3, 2, 1])
train(weights, train_datasets, 6000, 0.05)
assert predict(weights, [0, 1, 0], 0.35) == [0]
```
## Contributors
- See github for full [contributors list](https://github.com/bugagashenkj/neural-network/graphs/contributors)