Mind

Flexible neural networks in JavaScript.

Mind lets you easily create networks that learn to make predictions.

Star on GitHub

Demo Code

  let genres = [
    'Action',
    'Adventure',
    'Animation',
    'Comedy',
    'Drama',
    'Family',
    'Musical',
    'Mystery',
    'Romance',
    'Sci-Fi',
    'Sport',
    'Thriller',
    'War'
  ];

  let input = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];

  movie.genres.forEach(function(genre) {
    let index = genres.indexOf(genre);
    if (index > -1) input[index] = 1;
  });

  // train the network with the rating given by the user, scaled by 5
  var mind = Mind()
    .learn([
      { input: input, output: [ rating / 5 ] }
    ]);
    

Usage

  var mind = Mind()
    .learn([
      { input: [0, 0], output: [0] },
      { input: [0, 1], output: [1] },
      { input: [1, 0], output: [1] },
      { input: [1, 1], output: [0] }
    ])
    .predict([0, 1]); // ~1
    

Check out the full API on GitHub.

Install it...

$ npm install node-mind
    

Check out the module on NPM.