encyclopegia.org

Brain.js

Brain.js is a JavaScript library used for neural networking, which is released as free and open-source software under the MIT License.[src] It can be used in both the browser and Node.js backends.[src] Brain.js is most commonly used as a simple introduction to neural networking, as it hides complex mathematics and has a familiar modern JavaScript syntax.[src] It is maintained by members of the Brain.js organization and open-source contributors.[src]

Brain.js is a JavaScript library used for neural networking, which is released as free and open-source software under the MIT License.[src] It can be used in both the browser and Node.js backends.[src] Brain.js is most commonly used as a simple introduction to neural networking, as it hides complex mathematics and has a familiar modern JavaScript syntax.[src] It is maintained by members of the Brain.js organization and open-source contributors.[src] const net = new brain.NeuralNetwork(); net.train([ { input: [0, 0], output: [0] }, { input: [0, 1], output: [1] }, { input: [1, 0], output: [1] }, { input: [1, 1], output: [0] }, ]); console.log(net.run([1, 0])); Creating a recurrent neural network: const net = new brain.recurrent.RNN(); net.train([ { input: [0, 0], output: [0] }, { input: [0, 1], output: [1] }, { input: [1, 0], output: [1] }, { input: [1, 1], output: [0] }, ]); let output = net.run([0, 0]); // [0] output = net.run([0, 1]); // [1] output = net.run([1, 0]); // [1] output = net.run([1, 1]); // [0] Train the neural network on RGB color contrast: const net = new brain.NeuralNetwork(); net.train([{ input: { r: 0.03, g: 0.7, b: 0.5 }, output: { black: 1 } }, { input: { r: 0.16, g: 0.09, b: 0.2 }, output: { white: 1 } }, { input: { r: 0.5, g: 0.5, b: 1.0 }, output: { white: 1 } } ]); const output = net.run({ r: 1, g: 0.4, b: 0 }); // { white: 0.99, black: 0.002 } console.log(output)[src]

9 sentences · 9 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Brain.js." encyclopegia.org, 2024, https://encyclopegia.org/wiki/brain-js. Accessed 25 November 2026.

Chicago

"Brain.js." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/brain-js.

APA

encyclopegia.org. (2024). Brain.js. Retrieved November 25, 2026, from https://encyclopegia.org/wiki/brain-js

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1222133961 · 0.5 · snapshot enwiki-001222133961

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.