Skip to content

Reverse Text Color Based on Background Color Automatically using brain.js brain.NeuralNetwork()

Notifications You must be signed in to change notification settings

ullaskunder3/javascript-ml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Machine Leaning using Javascript

Brain.js

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 <script src="//unpkg.com/brain.js"></script>

Project Preview link 🤠

Preview 2 Preview 2
preview1 preview1

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

 * pen = 13-14 cm, 8 grams => 1
 * 
 * pencil = 14 - 15 cm, 6 gram => 0
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 }

About

Reverse Text Color Based on Background Color Automatically using brain.js brain.NeuralNetwork()

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published