Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

101
Visualizações
Can someone tell me what's wrong?
const net = new brain.NeuralNetwork();

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(net)

This should show me the neural network diagram but it doesn't I do have the HTML all set up and it's supposed to be working correctly but when I run it first it loads for longer than usual code does but I suppose its because I'm working with more complex stuff than usual and well I just get a blank screen so I would like if someone would help me out by telling me what the problem is

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>Storm</title>
    <script src="//unpkg.com/brain.js" defer></script>
    <script src="index.js" defer> </script>
  </head>
  <body>
    <div id="diagram">Diagram </div>
  </body>
</html>

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Your import is this:

    <script src="//unpkg.com/brain.js" defer></script>

But needs to be this:

<script src="https://unpkg.com/brain.js@1.0.0-rc.3/browser.js"></script>

https:// implies it will download it from a website, whereas yours // implies it will look on your local machine (your computer) for the file.

Since you didn't download the file, it won't load anything.

Maybe you want to use a different package, but the main issue is the import.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda