Lets discuss some housekeeping items.

There are several arguments and utilities used everywhere. You need to be aware of them so that you can manage chaining modules and passing data around.

The first parameter is vsize, which specifies the virtual size of an iSDP. Almost any module requires this argument during initialization, even the encoders.

The second most important parameter is spaOnbits also knowns as spa OR spa_nbits. Those refer to sparsity as percentage or as number of bits.

import sys
sys.path.extend(['../../ilib'])
from iutils import *

spaORnbits() function is used to convert between them and is used all across the modules :

spaORnbits(vsize=1000,spaOnbits=50)
(0.050, 50)
spaORnbits(vsize=1000,spaOnbits=0.02)
(0.020, 20)

MEDΒΆ

Minimum edit distance between symbol sequences :

med('abc','abd')
1.0
med('abcd','abdc')
2.0
med(['a','bc','abc'], ['a','bd','abc'])
1.0