def getSimplePatterns(numOnes, numPatterns, patternOverlap=0):
 assert (patternOverlap < numOnes)
 numNewBitsInEachPattern = (numOnes - patternOverlap)
 numCols = ((numNewBitsInEachPattern * numPatterns) + patternOverlap)
 p = []
 for i in xrange(numPatterns):
  x = numpy.zeros(numCols, dtype='float32')
  startBit = (i * numNewBitsInEachPattern)
  nextStartBit = (startBit + numOnes)
  x[startBit:nextStartBit] = 1
  p.append(x)
 return p

def getSimplePatterns ( numOnes , numPatterns , patternOverlap = 0 ) : assert ( patternOverlap < numOnes ) numNewBitsInEachPattern = ( numOnes - patternOverlap ) numCols = ( ( numNewBitsInEachPattern * numPatterns ) + patternOverlap ) p = [ ] for i in xrange ( numPatterns ) : x = numpy . zeros ( numCols , dtype = 'float32' ) startBit = ( i * numNewBitsInEachPattern ) nextStartBit = ( startBit + numOnes ) x [ startBit : nextStartBit ] = 1 p . append ( x ) return p
very simple patterns .