matiasvlevi / Dann

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

[🔷 Feature request ]: Sin wave dataset for Rann #37

Closed matiasvlevi closed 3 years ago

matiasvlevi commented 3 years ago

Feature

Segmented Sin wave dataset for Rann.

Type

Description

Just like we have XOR & Binary digit testing datasets for Dann models, it would be nice to have a testing dataset for the upcoming Rann model. The changes would have to be applied to origin/RNN branch. The method creating the dataset should be referenced in the module.exports in src/io/exports.js.

The source file for this method should be in src/core/datasets/

Context

We train a Rann model this way. We feed an array of sequences to the Rann model. The sequences lengths must be the same as the number of input neurons the Rann model has.

rnn.train([
  [0, 1],
  [2, 3],
  [4, 5]
]);

We could technically have a sin wave in an array of sequences to later train a model with.

let data = [
  [0, sinus values..., ],
  [sinus values continuation..., ],
  [sinus values continuation..., ],
  [sinus values continuation..., ],
]

Example

Here is an example of how the method could work.

let dataset = makeSinWave( sequence_length, total_length, resolution );
console.log(dataset);
SharkAce commented 3 years ago

I'm on it

matiasvlevi commented 3 years ago

Just merged, thanks!