Perfect, thanks for your insight!
I was just wondering if I could ask for some help in debugging some related code I am writing, because I think I am doing everything right in modulating the weights between pre
and post
ensembles (similarly to here) but the output of post
still does not seem to change. Some extra context of what I’m trying to achieve can be found here, but, to recap, I’m essentially trying to implement network weights using a memristor model.
My full code can be found here, but I’ll try and point out some highlights:
-
I’m working with the simplest supervised learning setup,
Learn
is anengo.Node()
where I implement my weights and learning rule:
-
This is a pictorial depiction of the relevant functional relationships in my model with “L” the control logic and “W” the weights matrix:
-
The first thing that the
Learn
node does is initialise an array of Memristors of size(post.n_neurons,pre.n_neurons)
(here)self.memristors = np.empty( (self.output_size, self.input_size), dtype=Memristor ) for i in range( self.output_size ): for j in range( self.input_size ): if self.type == "single": self.memristors[ i, j ] = Memristor( self.input_size, self.output_size, "excitatory", r0, r1, a, b ) if self.type == "pair": self.memristors[ i, j ] = MemristorPair( self.input_size, self.output_size, r0, r1, a, b )
-
Then at each timestep
dt
it checks which neurons inpre
have fired and applies the learning rule to the memristors representing its weights (here)spiked = True if input_activities[ j ] else False if spiked: # update memristor resistance state self.memristors[ i, j ].pulse( error )
-
Finally, it constructs a new weight matrix and convolves it with the input activations to give the connection’s outputs (here)
new_weights = extract_R_V(self.memristors) return np.dot( new_weights, input_activities )
I know that my weights are being modulated because I keep track of them internally and can plot them at the end:
What I don’t see is a correspondent change in the value represented by post
:
Am I missing something basic? Or is the error probably something more fundamental that I should look into?