https://github.com/ullaskunder3/javascript-ml
Reverse Text Color Based on Background Color Automatically using brain.js brain.NeuralNetwork()
https://github.com/ullaskunder3/javascript-ml
basic brain javascript ml training-data
Last synced: about 1 year ago
JSON representation
Reverse Text Color Based on Background Color Automatically using brain.js brain.NeuralNetwork()
- Host: GitHub
- URL: https://github.com/ullaskunder3/javascript-ml
- Owner: ullaskunder3
- Created: 2021-09-08T07:36:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-08T12:13:47.000Z (almost 5 years ago)
- Last Synced: 2025-02-08T22:25:34.603Z (over 1 year ago)
- Topics: basic, brain, javascript, ml, training-data
- Language: HTML
- Homepage: https://ullaskunder3.github.io/javascript-ml/
- Size: 95.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Machine Leaning using Javascript
## Brain.js
```block
Brain.js is a GPU accelerated library of neural networks written in JavaScript for browsers and Node.js. It is simple, fast and easy to use. It provides multiple neural network implementations as different neural nets can be trained to do different things well.
```
## Getting Started
There are multiple ways to use this library:
- NPM
`npm install --save brain.js`
- CDN
``
Project Preview [link 🤠](https://ullaskunder3.github.io/javascript-ml/)
| Preview 2 | Preview 2 |
|-----------------------------------|---------------------------------|
|  |  |
## Training
- Feedforward neural network (brain.NeuralNetwork)
One of the tasks that used the basic .NeuralNetwork flow was checking probability. Training data with `height` and `weight`
```task
* pen = 13-14 cm, 8 grams => 1
*
* pencil = 14 - 15 cm, 6 gram => 0
```
```js
network.train([
{input: {height: 13, weight: 8}, output: {pen: 1} },
{input: {height: 13, weight: 6}, output: {pencil: 0} },
{input: {height: 14, weight: 8}, output: {pen: 1} },
{input: {height: 15, weight: 6}, output: {pencil: 0} },
])
const result = network.run({height: 13, weight: 7})
console.log(result);
// { pen: 0.7718532681465149, pencil: 0.03233066201210022 }
```