def buildSequencePool(numSequences=10, seqLen=[2, 3, 4], numPatterns=5, numOnBitsPerPattern=3, patternOverlap=0, **kwargs):
 patterns = getSimplePatterns(numOnBitsPerPattern, numPatterns, patternOverlap)
 numCols = len(patterns[0])
 trainingSequences = []
 for _ in xrange(numSequences):
  sequence = []
  length = random.choice(seqLen)
  for _ in xrange(length):
   patIdx = random.choice(xrange(numPatterns))
   sequence.append(patterns[patIdx])
  trainingSequences.append(sequence)
 if (VERBOSITY >= 3):
  print '\nTraining sequences'
  printAllTrainingSequences(trainingSequences)
 return (numCols, trainingSequences)

def buildSequencePool ( numSequences = 10 , seqLen = [ 2 , 3 , 4 ] , numPatterns = 5 , numOnBitsPerPattern = 3 , patternOverlap = 0 , ** kwargs ) : patterns = getSimplePatterns ( numOnBitsPerPattern , numPatterns , patternOverlap ) numCols = len ( patterns [ 0 ] ) trainingSequences = [ ] for _ in xrange ( numSequences ) : sequence = [ ] length = random . choice ( seqLen ) for _ in xrange ( length ) : patIdx = random . choice ( xrange ( numPatterns ) ) sequence . append ( patterns [ patIdx ] ) trainingSequences . append ( sequence ) if ( VERBOSITY >= 3 ) : print '\nTraining sequences' printAllTrainingSequences ( trainingSequences ) return ( numCols , trainingSequences )
create a bunch of sequences of various lengths .