BrainJS / BrainJS/brain.js

For LSTMTimeStep, how can I train data in the form of tensor (a, b, c)?

Open
#839 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

tensor(a, b, c):

- `a`: samples
- `b`: time steps
- `c`: features

For example tensor(3, 4, 2):
![image](https://user-images.githubusercontent.com/15623620/186563619-f2fc1e8a-aada-4dd1-83ae-20cc622bfc51.png)

![image](https://user-images.githubusercontent.com/15623620/186563819-bd1d70ea-a02e-429f-aea0-4f25b0fbb554.png)

So, How can I process them as input parameters of LSTMTimeStep?

```
net.train([
{ input: [11, 12], output: [1] },
{ input: [13, 14], output: [2] },
{ input: [15, 16], output: [3] },
{ input: [17, 18], output: [4] },
])

net.train([
{ input: [21, 22], output: [5] },
{ input: [23, 24], output: [6] },
...
])

...net.train(...)
```
OR:
```
net.train([
{ input: [
[11, 12],
[13, 14],
[15, 16],
[17, 18]
],
output: [4]},
])

net.train([
{ input: [
[21, 22],
[23, 24],
...
],
output: [8]},
])

...net.train(...)
```

The question may be quite simple. Looking forward to your answer!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.