@00f100/neuralnetworkjs 中文文档教程

发布于 5年前 浏览 20 项目主页 更新于 3年前

NeuralNetworkJS

HTML 文件中 JS

How to install

$ npm install @00f100/neuralnetworkjs

中的神经网络,在此示例中包含脚本

<script type="text/javascript" src="node_modules/@00f100/neuralnetworkjs/src/neural-network.js"></script>

How to use

,想象一下:

neural network example

// weightSeq are the weights to apply. If null is generated.
var context = {
    weightSeq: null
};

// "matrix" is a list of weights to apply. If the length of the "matrix" list is different from the total "matrix weights", it will be ignored and "context.weightSeq" will be used.
var matrix = [];

// "input" data to input
var input = [1, 5, 20, 4, 204, 43];

// "hiddenColumn" hidden columns of neurons
var hiddenColumn = 3;

// "hiddenRow" hidden rows of neurons
var hiddenRow = 4;

// "outputColumns" output options. Return array integer 0 or 1, ex: [1, 0, 1]
var outputColumns = 3;

// "outputData" is a callback function to see output result
var outputData = function(output) {
    console.log(output); // ex: [1, 0, 1]
}

// Execute neural network
NeuralNetwork.exec(context, matrix, input, hiddenColumn, hiddenRow, outputColumns, outputData);

NeuralNetworkJS

Netural network in JS

How to install

$ npm install @00f100/neuralnetworkjs

in HTML file, include script

<script type="text/javascript" src="node_modules/@00f100/neuralnetworkjs/src/neural-network.js"></script>

How to use

in this example, imagine this:

neural network example

// weightSeq are the weights to apply. If null is generated.
var context = {
    weightSeq: null
};

// "matrix" is a list of weights to apply. If the length of the "matrix" list is different from the total "matrix weights", it will be ignored and "context.weightSeq" will be used.
var matrix = [];

// "input" data to input
var input = [1, 5, 20, 4, 204, 43];

// "hiddenColumn" hidden columns of neurons
var hiddenColumn = 3;

// "hiddenRow" hidden rows of neurons
var hiddenRow = 4;

// "outputColumns" output options. Return array integer 0 or 1, ex: [1, 0, 1]
var outputColumns = 3;

// "outputData" is a callback function to see output result
var outputData = function(output) {
    console.log(output); // ex: [1, 0, 1]
}

// Execute neural network
NeuralNetwork.exec(context, matrix, input, hiddenColumn, hiddenRow, outputColumns, outputData);
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文