Understanding the weight probe

I’m trying to visualise how the weights of an ensemble change over time while using a learning rule. I understand that I need to use a weights probe, as shown in this example, however I’m a bit confused on how to interpret the results.

The probe returns an t-by-D-by-N tensor, where:

  • t is the time-steps
  • D is the dimensions of the ensemble
  • N is the number of neurons

Assuming the output is connected to a D dimensional node, how am I supposed to understand the various values associated to this tensor? For example, assume a tensor called weights.

Would it be correct to say:

  1. weights[:, :, 0] shows the change in weights over time for all weights leaving the neuron at index 0?
  2. weights[:, 0, :] shows the change in weights over time for the zeroth dimension of all neurons?
  3. weights[0, :, :]
  4. To access all the weights for analysis (I’m trying to find which ones keep returning to the same value instead of converging), I should change the dimensions of the tensor to t-by-D*N?

Finally, was this documented anywhere? I couldn’t find it in the connection documentation.

All the weight probe does is copy the weight matrix at every time step (the same idea as how any other probe copies the value of the probed attribute each timestep). In your case (connecting from N neurons to a D-dimensional node) that weight matrix will be DxN. So when you save that at every time step you get a txDxN shaped array.

So weights[:, :, 0] gives you the output weights from neuron 0 at each timestep, weights[:, 0, :] gives you the input weights to dimension 0 in the node at each timestep, and weights[0, :, :] gives you the weight matrix on the first timestep. And the full array gives you all the weights for analysis.

2 Likes

recommended to use the sample_every flag when probing weights if your probe data size is becoming cumbersome! i had forgotten about it, and found it most helpful when trevor reminded me of it.

1 Like