@@ -0,0 +1,449 @@
+from nupic.encoders.scalar import ScalarEncoder%0Afrom nupic.encoders.random_distributed_scalar import RandomDistributedScalarEncoder as RDSE%0A%0Aimport numpy as np%0A%0Atotal=100000%0AminV=0%0AmaxV=total%0A%0Adata=np.random.randint(minV, maxV+1, total)%0A%0AencScalar = ScalarEncoder(w=21, minval=minV, maxval=maxV, resolution=1)%0AencRDSE = RDSE(resolution=1)%0A%0Afor d in data:%0A  encScalar.encode(d)%0A  encRDSE.encode(d)%0A%0Aprint %22Scalar n=%22,encScalar.n,%22 RDSE n=%22,encRDSE.n%0A

add encoder Scalar vs RDSE benchmark