# multiple classification with LSTM in tensorflow js

I am learning tensorflow js, and I try some new things to me:

The situation: I generate false data of this type:

inputs:
[[12], [18], [12], [12], [18], [12], [12], [12]]
...
[[12], [12], [18], [12], [12], [12], [18], [12]]

labels one hot encoded:
[[1, 0], [0, 1] ...]

[1, 0] = "normal" (12)
[0, 1] = "error" (18)


then I have this model:

const model = tf.sequential();
model.add(tf.layers.dense({  inputShape: [1], units: 30, activation: "relu" }));
model.add(tf.layers.dense({  units: 2, activation: "softmax" })); // softmax and sigmoid works


after training, I test some data:

example:
[[12], [18]]
it work well:
[[0.98, 0.003], [0.003, 0.98]]


My problem: I want to go deeper, I want to predict the correct label on these type of data:

inputs:
[[12], [18], [12], [12], [12], [6], [8], [7]]
...
[[12], [12], [18], [12], [18], [12], [6], [7]]

labels one hot encoded:
[1, 0, 0] = "normal" (12)
[0, 1, 0] = "error1" (18)
[0, 0, 1] = "error2" (6)


8-7 is a "normal corrupted data": after an error2 there is some factor on normal data

I want to find the right label for all data and I want to use LSTM for that, but how can I present my data so they have a "sequence" format ? is the size of the time is arbitrary ?

I tried things like:

const model = tf.sequential();
model.add(tf.layers.inputLayer({  inputShape: [3, 1] })); // inputShape: [5, 1], [1, 1]...