NuPIC
0.2.7.dev0
Numenta Platform for Intelligent Computing

Pass an encoded SDR straight to the model. More...
Public Member Functions  
def  __init__ 
n – is the total #bits in output w – is used to normalize the sparsity of the output, exactly w bits ON, if None (default)  do not alter the input, just pass it further. More...  
def  getDecoderOutputFieldTypes 
[Encoder class virtual method override]  
def  getScalars 
See method description in base.py.  
def  getBucketIndices 
See method description in base.py.  
def  encodeIntoArray 
See method description in base.py.  
def  decode 
See the function description in base.py.  
def  getBucketInfo 
See the function description in base.py.  
def  topDownCompute 
See the function description in base.py.  
def  closenessScores 
Does a bitwise compare of the two bitmaps and returns a fractonal value between 0 and 1 of how similar they are. More...  
Public Member Functions inherited from Encoder  
def  getWidth 
Should return the output width, in bits. More...  
def  encodeIntoArray 
Encodes inputData and puts the encoded value into the numpy output array, which is a 1D array of length returned by getWidth(). More...  
def  setLearning 
Set whether learning is enabled. More...  
def  setFieldStats 
This method is called by the model to set the statistics like min and max for the underlying encoders if this information is available. More...  
def  encode 
Convenience wrapper for encodeIntoArray. More...  
def  getScalarNames 
Return the field names for each of the scalar values returned by getScalars. More...  
def  getDecoderOutputFieldTypes 
Returns a sequence of field types corresponding to the elements in the decoded output field array. More...  
def  setStateLock 
Setting this to true freezes the state of the encoder This is separate from the learning state which affects changing parameters. More...  
def  getEncoderList 
def  getScalars 
Returns a numpy array containing the subfield scalar value(s) for each subfield of the inputData. More...  
def  getEncodedValues 
Returns the input in the same format as is returned by topDownCompute(). More...  
def  getBucketIndices 
Returns an array containing the subfield bucket indices for each subfield of the inputData. More...  
def  scalarsToStr 
Return a pretty print string representing the return values from getScalars and getScalarNames(). More...  
def  getDescription 
This returns a list of tuples, each containing (name, offset). More...  
def  getFieldDescription 
Return the offset and length of a given field within the encoded output. More...  
def  encodedBitDescription 
Return a description of the given bit in the encoded output. More...  
def  pprintHeader 
Prettyprint a header that labels the subfields of the encoded output. More...  
def  pprint 
Prettyprint the encoded output using ascii art. More...  
def  decode 
Takes an encoded output and does its best to work backwards and generate the input that would have generated it. More...  
def  decodedToStr 
Return a pretty print string representing the return value from decode().  
def  getBucketValues 
Returns a list of items, one for each bucket defined by this encoder. More...  
def  getBucketInfo 
Returns a list of EncoderResult namedtuples describing the inputs for each subfield that correspond to the bucket indices passed in 'buckets'. More...  
def  topDownCompute 
Returns a list of EncoderResult namedtuples describing the topdown best guess inputs for each subfield given the encoded output. More...  
def  closenessScores 
Compute closeness scores between the expected scalar value(s) and actual scalar value(s). More...  
def  getDisplayWidth 
Calculate width of display for bits plus blanks between fields. More...  
def  formatBits 
Copy one array to another, inserting blanks between fields (for display) If leftpad is one, then there is a dummy value at element 0 of the arrays, and we should start our counting from 1 rather than 0. More...  
Pass an encoded SDR straight to the model.
Each encoding is an SDR in which w out of n bits are turned on. The input should be a 1D array or numpy.ndarray of length n
def __init__  (  self,  
n,  
w = None , 

name = "pass_through" , 

forced = False , 

verbosity = 0 

) 
n – is the total #bits in output w – is used to normalize the sparsity of the output, exactly w bits ON, if None (default)  do not alter the input, just pass it further.
forced – if forced, encode will accept any data, and just return it back.
def closenessScores  (  self,  
expValues,  
actValues,  
kwargs  
) 
Does a bitwise compare of the two bitmaps and returns a fractonal value between 0 and 1 of how similar they are.
1 => identical 0 => no overlaping bits
kwargs will have the keyword "fractional", which is assumed by this encoder