Generate many pairs of normalized random vectors, fi and gi. (b)(1 point) Compute the outer product matrices,
Question:
Generate many pairs of normalized random vectors, fi and gi.
(b)(1 point) Compute the outer product matrices, Ai = gifiT.
(c)(1 point) Form the overall connectivity matrix, A, as the sum of the individual outer product matrices, that is, A = Σ Ai/i A will change as it accumulates more and more pairs. Constructing truly orthogonal sets of vectors can be done but is not easy except for one trivial case. (Do you know what it is?). So trust to high dimensionality to let you approximate real orthogonality. This approximation is a more realistic and interesting case in any event.
(d)(3 points) Test the resulting matrix A from above as follows:
(i) Compute the predicted output, let's call it g', for each stored input, fi using A.
(ii) Compare it with what it should be (i.e., the gi used to construct A) by computing the cosine between your predicted output, g', and the actual/observed output gi.
(iii) Compute the length of the output vector, g'.
(iv) Test the selectivity of the system by generating a new set of 50 random vectors, let's call them hi, and computing the predicted outputs (hi') using the A matrix you constructed above (i.e., find the matrix product between each hi vector and A: Ahi). If the system develops any selectivity, we hope that the output of the system from a new random vector will be small. To check, compute the length of the output vectors (hi') for the new random vectors and the length of the vectors that were stored (gi) for your connectivity matrix A. Compare the average length of hi' to the average length of gi (gi is normalized, so you know its length.) (Optional: If you feel ambitious, you might plot the length data collected here in the form of a histogram as you did before in homework 1. You might want to generate many more random vectors (say 500) so that the histogram is reliable.)