It can be tested by running python interactively:
$ python -i seq_learn.py
>>>
>>> roll('The quick brown fox jumped over the lazy dog')
roll() accepts two parameters - first is an input sequence and an optional second parameter which is the number of auto-predictions to make after the input sequence was fed into predictor.
The sequence can be any string (text between quotes) which is split in words by spaces and each new word is assigned a new random SDR in a dictionary. Previously seen words will retrieve their original SDR from dictionary.
Then the list of word-associated SDR list is fed into sequence predictor ( SeqPred.predict() )
roll() prints two outputs - first is a list of
(actual_input > predicted_input) pairs on the input string. An underscore (aka ‘_’) means empty/no prediction was found.
If a number of auto-fed predictions is specified then prints whatever sdrs (actually their associated words in dictionary) were self predicted, separated by ‘>’
The self prediction loop ends after either the prediction failed to retrieve anything or the specified number of predictions were found.
Predicted sequence-lines end with ‘.’
PS what should be mentioned is something goes wrong
>>> roll('The quick brown fox jumped over the lazy dog')
rolling: "['The', 'quick', 'brown', 'fox', 'jumped', 'over', 'the', 'lazy', 'dog']" :
(INPUT,PREDICTED)... (The>_),(quick>_),(brown>brown),(fox>_),(jumped>_),(over>_),(the>_),(lazy>jumped),(dog>dog), .
>>> roll('The quick', 10)
rolling: "['The', 'quick']" :
(INPUT,PREDICTED)... (The>_),(quick>brown),
AUTO FEED: >fox>jumped>over>the>lazy>dog>The>quick>brown>fox .
As you see when it first sees the words makes strange prediction.
Second time I give it the first two words in sequence (with 10 auto-feeds) and it seems to work correctly.
What bugs me is the weird predictions made when first rolling a sequence