Great that you will do that! I just realized I need to make a slight change in the js code so that the last chunks are still sane, I’ll repost the corrected version in this thread soon!
The purpose of it would be that you have a multichannel buffer with some recorded data (for example a 3-channel buffer with xyz coordinates). Since mlp-s are originally not meant for time series prediction, we have to “hack” some temporal representation of the data. One of the simplest ways to do this is to chunk up the timeseries with the same window, offset by one step at the target dataset. The size of this window (which I call
@chunksize in the Max abstraction, but I am open to other suggestions) will be the extent of our “fake” memory. So if your timeseries is “1234567”, and
chunksize=3, we should have the following chunks:
| step | input | target |
| 0. | “123” | “234” |
| 1. | “234” | “345” |
| 2. | “345” | “456” |
| 3. | “456” | “567” |
[at the moment it actually goes on further with 0 values in the end, so I’ll have to fix that.]
I try to pseudo-codify it here:
0. Take the source buffer and
chunksize, and 2
fluid.dataset~s, one will hold the input data, the other the target data.
- Flatten the source buffer into an internal one with
fluid.bufflatten~, let’s call this
databuffer. The number of channels in the original source buffer can be stored as
numfeatures. You will also need a
counter for the labels, and an
index to remember where we are in the
databuffer (if you want to follow my implementation). You can also
fluid.dataset~ s, so that this whole op can be repeated without them complaining.
while index+(numfeatures*chunksize) < databuffer.length: (here I forgot the “+(numfeatures*chunksize)” in the original version)
databuffer[index:index+(numfeatures*chunksize)] as an entry with label as
counter in a
fluid.dataset~ for the inputs.
databuffer[index+numfeatures:index+numfeatures+(numfeatures*chunksize)]as an entry with label as
counter in a
fluid.dataset~ for the targets.
- After the while loop has finished, output a “done” event (or doneaction?).
EDIT: so after some testing I realized that the while loop condition should be
while index+(numfeatures*chunksize) < databuffer.length:
EDIT 2: I should read my own code. (Made some other changes above.) Sorry for spamming.