Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gsteixeira/neuralnetwork-r
A neural network implementation in R
https://github.com/gsteixeira/neuralnetwork-r
Last synced: about 5 hours ago
JSON representation
A neural network implementation in R
- Host: GitHub
- URL: https://github.com/gsteixeira/neuralnetwork-r
- Owner: gsteixeira
- Created: 2021-10-01T03:02:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-01T03:40:10.000Z (about 3 years ago)
- Last Synced: 2023-12-14T16:57:42.618Z (11 months ago)
- Language: R
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A Neural Network in R
A simple neural network implementation in R
## usage:
```shell
Rscript neural.R
# or
make
```## Create a neural network:
Create a network telling the size (nodes) of earch layer.
```R
input_size <- 2
output_size <- 1
# training parameters
inputs <- array(c(0, 1, 0, 1, 0, 0, 1, 1), dim=c(4, input_size))
outputs <- array(c(0.0, 1.0, 1.0, 0.0), dim=c(4, output_size))
# Create the network
nn <- NewNeuralNetwork(num_input_layer, output_size, num_hidden_nodes)
# Train
iteracions <- 10000
nn <- train(nn, inputs, outputs, iteracions)
# now make some predictions
predicted <- predict(nn, c(1, 0));
print(predicted)
# ~ [0.9]
```## to run tests:
```shell
Rscript neural.R test
# or
make test
```