matiasvlevi / Dann

Deep Neural Network Library for JavaScript.
https://dannjs.org
MIT License
425 stars 23 forks source link

[🔷 Feature request ]: RNNs for Dannjs #25

Open matiasvlevi opened 3 years ago

matiasvlevi commented 3 years ago

Feature

Recurrent Neural Networks for Dannjs,

Type

Description

Adding a new class for RNNs would be interesting. The class would likely be called Rann for Recurrent Artificial Neural Network, instead of the Dann acronym which stands for Deep Artificial Neural Network. This would be a pretty time-consuming feature to implement. It would require lots of testing before we can publish the feature to the master branch. Maybe creating another testing/dev branch for this feature would be necessary.

Examples

These are really early examples and might be completely different once we impelent the feature. This would create the RNN.

const rnn = new Rann(input_neurons, hidden_neurons, output_neurons);

We could feed a Rann a set of sequences

let rnn = new Rann(2, 20, 2);
rnn.train([
  [1, 2],
  [3, 4],
  [5, 6],
  [7, 8]
],
[9, 10]
);
rnn.feed([
  [1, 2],
  [3, 4]
]);
// would return [5, 6]

Note

This is, of course, early speculation about a big addition to the library. It might take quite some time to create & test, and usability might change a whole lot throughout development. I'm assigning this issue to myself because I want to start working on it, but help and criticism are welcome.

matiasvlevi commented 3 years ago

Added the RNN dev branch here

matiasvlevi commented 3 years ago

Added Rann.prototype.train method and it seems to work well. Check it out in the RNN branch