Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Solving logical problem #51

Open
ghost opened this issue Dec 3, 2014 · 1 comment
Open

Solving logical problem #51

ghost opened this issue Dec 3, 2014 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 3, 2014

There is a relatively complex single player game called peg solitaire: http://en.wikipedia.org/wiki/Peg_solitaire . I intend to win this game with a learning algorithm. Do you think brain.js is capable to do that, or can you suggest something about how to start with these kind of algorithms?

@robertleeplummerjr
Copy link

I really like your thought here. I believe this could easily be solved with the recurrent neural net implemented here: https://github.com/harthur-org/brain.js (the community continuation of the lib). I believe the means of solving this would simply be iteration of every mathematical means of solving the puzzle. The questions is, how would you predict the next move(s)? Would you do one at a time, looking to the next, or would you solve from the beginning to end?

Here is an example:

import LSTM from '../../src/recurrent/lstm';
import Vocab from '../../src/utilities/vocab';
var net = new LSTM({
  vocab: Vocab.allPrintableSeparated()
});
net.train([
  {
    input: 'hi',
    output: 'mom!'
  }, {
    input: 'hello',
    output: 'dad!'
  }
]);

console.log(net.run('hi')); //some variation of "mom!"
console.log(net.run('hello')); //some variation of "dad!"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant