TensorFlow.js example: Trains LSTM model to perform the following sequence task:

Given a sequence of 0s and 1s of fixed length (10), output a single binary number (0 or 1).

The training data has the following pattern:

The output (i.e., label) is 1 if there are four or more consecutive and identical
items (either 0s or 1s) in the input sequence. Otherwise, the output is 0. For example:
   Sequence [0, 1, 0, 1, 0, 1, 0, 0, 1, 0] --> Label: 0.
   Sequence [0, 1, 1, 1, 1, 0, 1, 0, 0, 1] --> Label: 1.
   Sequence [0, 0, 0, 0, 0, 0, 1, 0, 0, 1] --> Label: 1.
Epochs to train:

...