OUTPUTS = 4
net = buildNetwork(INPUTS, HIDDEN, OUTPUTS, hiddenclass=LSTMLayer, outclass
    =SigmoidLayer, recurrent=True)
ds = SequentialDataSet(INPUTS, OUTPUTS)
for sequence in your_sequences:
    for inpt, target in zip(sequence, sequence[1:]):
        ds.newSequence()
ds.appendLinked(inpt, target)
net.randomize()
trainer = BackpropTrainer(net, ds, learningrate=0.05, momentum=0.99)
for _ in range(1000):
    pass
Machine Learning Algorithm for Predicting Order of Events?