How to configure the code of Spaun so that it can be used to do character recognition?


I’m trying to implement an extra functionality which seems like the recognizing digits task but recognizing characters(‘a’, ‘b’,‘c’, …) in Spaun. I have worked for weeks and I tune the code that can input my own ‘picture’ as input but it still output an estimated digit.

Next step, I prepare to change the semantic pointer which is loaded by Spaun(the ‘class_means.npz’ and ‘params.npz’).

So, what I want to know is that should I change the network structure of Spaun to implement my task? If not, what’s the meaning of the data in ‘class_means.npz’(I think it has some relation with the data in ‘params.npz’ but I can not find their relationship).


Spaun uses a Deep Learning network converted to spiking neurons to recognize the digits. When you say “tune the code” do you mean you’ve trained a new network and put it inside Spaun?


Thank you for your reply, Seanny.

Yesterday I saw an article that shows how to train a network which can be used by SNN(

Is this the way you trained the network?

I know little about this. When I saw the source code about Spaun, it loads many file, which terminate in ‘.npz’, I think this may be the structure of the network.

self.vision_network_filename = os.path.join(self.filepath, 'params.npz')
self.vision_network_data = np.load(self.vision_network_filename)
self.weights = self.vision_network_data['weights']
self.biases = self.vision_network_data['biases']
weights_class = self.vision_network_data['Wc']
biases_class = self.vision_network_data['bc']

I think the ‘weights’ and ‘bias’ in ‘params.npz’ is the parameters of the network, the ‘Wc’ is used to calculate the semantic pointer(I think), dose it has a relationship with the ‘weights’ and ‘bias’?

Besides, I don’t know the meaning of ‘class_means.npz’, could you please tell me how to get the params, thank you!


Yes, that link is an example of how to train a network using Deep Learning and I think it would be suitable for use with Spaun.

@xchoo do you have any documentation on the format of the files class_means.npz and params.npz, as well as how you generate them?