<div class="container">
  <div class="row">
    <div class="col-sm-12">
      <input type ="text" id ="inputText">
    </div> <!-- end of col-sm-12 -->
  </div> <!-- end of row --.
</div> <!-- end of container -->
const brain = require('brain.js');
alert("ok")

var net = new brain.NeuralNetwork();

console.log("The following neural network implements an XOR (exclusive OR) logical operation, where the output will be true when the inputs are neither all false or all true.");
console.log("Training the model...");
net.train([
    { input: [0, 0], output: [0] },
    { input: [0, 1], output: [1] },
    { input: [1, 0], output: [1] },
    { input: [1, 1], output: [0] }
]);


console.log("Evaluating [1, 1] against the model (should approach 0)...");
console.log(net.run([1, 1]));

console.log("Evaluating [1, 0] against the model (should approach 1)...");
console.log(net.run([1, 0]));
Run Pen

External CSS

  1. https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css
  2. https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/brain/0.6.3/brain.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/brain/0.6.3/training-worker.min.js