Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

104
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!