A basic question about htm.core

hi
In the “hello_sp.py” code in htm.core if we want use one of the MNIST dataset like num1.png instead of random input,What should we do? how is “inputSDR” defined in this case?

I know for random input, “inputSDR” defined as below:
inputSDR.randomize( .02 )

Please tell me how to define the input (inputSDR) as a digit of MNIST dataset?

sincerely
katrin

1 Like

Hi Katrin,

You should look for the file: htm.core/py/htm/examples/mnist.py which has an example of that. The mnist input is encoded as encoder_output.dense = data >= np.mean(data) which works because the MNIST images are black and white.

thank you. It was finally resolved

2 Likes