【问题标题】:brain.js not showing a result + showing "output" as wrongBrain.js 未显示结果 + 将“输出”显示为错误
【发布时间】:2021-12-19 09:11:00
【问题描述】:

我不得不说“我刚开始使用神经网络,我几乎为零知道自己在做什么。”

我的代码: index.html

<!DOCTYPE html>
<html lang ="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=safari">
    <title>Document</title> 
    <script src="//unpkg.com/brain.js" defer></script>
    <script src="brain.js" defer></script>
</head>
<body>
    <div id="diagram"></div>
</body>
</html>

大脑.js

const config = {
    binaryThresh: 0.5,
    hiddenLayers: [3], 
    activation: 'sigmoid' 
};
  
const net = new brain.NeuralNetwork(config);

net.train([
    {
        input: [0, 0]
        output: [0]
    },
    {
        input: [1, 0]
        output: [1]
    },
    {
        input: [0, 1]
        output: [1]
    },
    {
        input: [1, 1]
        output: [0]
    }
])

const diagram = document.getElementById("diagram")
diagram.innerHTML = brain.utilities.toSVG()

我想使用brain.js 详细信息:在 Mac 上,在 Visual Studio 上,无法在线找到答案

【问题讨论】:

  • 接受您的回答,将您的问题标记为已解决。

标签: javascript html brain.js


【解决方案1】:

我忘了在输入后加逗号

对不起

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 2022-12-10
  • 2018-10-31
  • 2019-07-23
  • 2020-04-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-02-19
  • 1970-01-01
相关资源
最近更新 更多