https://github.com/karantan/go-perceptron
A simple implementation of the perceptron algorithm in Go
https://github.com/karantan/go-perceptron
Last synced: about 2 months ago
JSON representation
A simple implementation of the perceptron algorithm in Go
- Host: GitHub
- URL: https://github.com/karantan/go-perceptron
- Owner: karantan
- License: bsd-3-clause
- Created: 2021-09-16T07:27:52.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-16T16:24:43.000Z (over 3 years ago)
- Last Synced: 2025-02-13T15:53:51.691Z (4 months ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-perceptron
A simple implementation of the [perceptron algorithm](https://en.wikipedia.org/wiki/Perceptron)
in Go.## Usage
```
$ git clone [email protected]:karantan/go-perceptron.git
$ cd go-perceptron
$ go run main.go
Starting weights 0.05628316484698421 0.46671059597618897 bias 0.3007628894709572
Iteration 0
0 or 0 = 0 (desired output: 0)
Adjusted weights 0.05628316484698421 0.46671059597618897 bias 0.3007628894709572
0 or 1 = 0 (desired output: 1)
Adjusted weights 0.05628316484698421 0.566710595976189 bias 0.4007628894709572
1 or 0 = 0 (desired output: 1)
Adjusted weights 0.1562831648469842 0.566710595976189 bias 0.5007628894709572
1 or 1 = 1 (desired output: 1)
Adjusted weights 0.1562831648469842 0.566710595976189 bias 0.5007628894709572
Iteration error 2Iteration 1
0 or 0 = 0 (desired output: 0)
Adjusted weights 0.1562831648469842 0.566710595976189 bias 0.5007628894709572
0 or 1 = 1 (desired output: 1)
Adjusted weights 0.1562831648469842 0.566710595976189 bias 0.5007628894709572
1 or 0 = 0 (desired output: 1)
Adjusted weights 0.2562831648469842 0.566710595976189 bias 0.6007628894709571
1 or 1 = 1 (desired output: 1)
Adjusted weights 0.2562831648469842 0.566710595976189 bias 0.6007628894709571
Iteration error 1Iteration 2
0 or 0 = 0 (desired output: 0)
Adjusted weights 0.2562831648469842 0.566710595976189 bias 0.6007628894709571
0 or 1 = 1 (desired output: 1)
Adjusted weights 0.2562831648469842 0.566710595976189 bias 0.6007628894709571
1 or 0 = 0 (desired output: 1)
Adjusted weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
1 or 1 = 1 (desired output: 1)
Adjusted weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
Iteration error 1Iteration 3
0 or 0 = 0 (desired output: 0)
Adjusted weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
0 or 1 = 1 (desired output: 1)
Adjusted weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
1 or 0 = 1 (desired output: 1)
Adjusted weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
1 or 1 = 1 (desired output: 1)
Adjusted weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
Iteration error 0Final weights 0.3562831648469842 0.566710595976189 bias 0.7007628894709571
```