mind.js
mind.js 介绍
Node.js和浏览器的灵活神经网络库,基本上学习如何进行预测,使用矩阵实现来处理训练数据并启用可配置的网络拓扑。您还可以即插即用已经学过的“思想”,这对您的应用程序非常有用。
特征
矢量化 - 使用矩阵实现来处理训练数据
可配置 - 允许您自定义网络拓扑
可插拔 - 下载/上传已经学过的头脑
安装
yarn add node-mind使用const Mind = require('node-mind');/*** Letters.** - Imagine these # and . represent black and white pixels.*/const a = character('.#####.' +'#.....#' +'#.....#' +'#######' +'#.....#' +'#.....#' +'#.....#')const b = character('######.' +'#.....#' +'#.....#' +'######.' +'#.....#' +'#.....#' +'######.')const c = character('#######' +'#......' +'#......' +'#......' +'#......' +'#......' +'#######')/*** Learn the letters A through C.*/const mind = new Mind({ activator: 'sigmoid' }).learn([{ input: a,output: map('a') },{ input: b,output: map('b') },{ input: c,output: map('c') }])/*** Predict the letter C,even with a pixel off.*/const result = mind.predict(character('#######' +'#......' +'#......' +'#......' +'#......' +'##.....' +'#######'))console.log(result) // ~ 0.5/*** Turn the # into 1s and . into 0s.*/function character(string) {return string.trim().split('').map(integer)function integer(symbol) {if ('#' === symbol) return 1if ('.' === symbol) return 0}}/*** Map letter to a number.*/function map(letter) {if (letter === 'a') return [ 0.1 ]if (letter === 'b') return [ 0.3 ]if (letter === 'c') return [ 0.5 ]return 0}链接: http://www.fly63.com/nav/2088网站地址:http://stevenmiller888.github.io/mindjs.net/
GitHub:https://github.com/stevenmiller888/mind
网站描述:一个用JavaScript构建的神经网络库