I’ve been trying for days to figure out what I’m doing wrong. I realize that looping through 3 times is wrong, but doing so is the only way it comes out with the “right answer”, which obviously means there’s something wrong in my code. But I don’t know what.
My most recent investigations have revealed that the “piece” of the caches list that I need to use in my final layer appears to be part of my third loop, which is why it can’t retrieve it until it runs 3 times. I don’t understand what’s going on.
After I run my code, I print t_caches and get:
[((array([[-0.31178367, 0.72900392, 0.21782079, -0.8990918 ],
[-2.48678065, 0.91325152, 1.12706373, -1.51409323],
[ 1.63929108, -0.4298936 , 2.63128056, 0.60182225],
[-0.33588161, 1.23773784, 0.11112817, 0.12915125],
[ 0.07612761, -0.15512816, 0.63422534, 0.810655 ]]),
array([[ 0.35480861, 1.81259031, -1.3564758 , -0.46363197, 0.82465384],
[-1.17643148, 1.56448966, 0.71270509, -0.1810066 , 0.53419953],
[-0.58661296, -1.48185327, 0.85724762, 0.94309899, 0.11444143],
[-0.02195668, -2.12714455, -0.83440747, -0.46550831, 0.23371059]]),
array([[ 1.38503523],
[-0.51962709],
[-0.78015214],
[ 0.95560959]])),
array([[-5.23825714, 3.18040136, 0.4074501 , -1.88612721],
[-2.77358234, -0.56177316, 3.18141623, -0.99209432],
[ 4.18500916, -1.78006909, -0.14502619, 2.72141638],
[ 5.05850802, -1.25674082, -3.54566654, 3.82321852]])),
((array([[0. , 3.18040136, 0.4074501 , 0. ],
[0. , 0. , 3.18141623, 0. ],
[4.18500916, 0. , 0. , 2.72141638],
[5.05850802, 0. , 0. , 3.82321852]]),
array([[-0.12673638, -1.36861282, 1.21848065, -0.85750144],
[-0.56147088, -1.0335199 , 0.35877096, 1.07368134],
[-0.37550472, 0.39636757, -0.47144628, 2.33660781]]),
array([[ 1.50278553],
[-0.59545972],
[ 0.52834106]])),
array([[ 2.2644603 , 1.09971298, -2.90298027, 1.54036335],
[ 6.33722569, -2.38116246, -4.11228806, 4.48582383],
[10.37508342, -0.66591468, 1.63635185, 8.17870169]])),
((array([[ 2.2644603 , 1.09971298, 0. , 1.54036335],
[ 6.33722569, 0. , 0. , 4.48582383],
[10.37508342, 0. , 1.63635185, 8.17870169]]),
array([[ 0.9398248 , 0.42628539, -0.75815703]]),
array([[-0.16236698]])),
array([[-3.19864676, 0.87117055, -1.40297864, -3.00319435]])),
((array([[ 2.2644603 , 1.09971298, 0. , 1.54036335],
[ 6.33722569, 0. , 0. , 4.48582383],
[10.37508342, 0. , 1.63635185, 8.17870169]]),
array([[ 0.9398248 , 0.42628539, -0.75815703]]),
array([[-0.16236698]])),
array([[-3.19864676, 0.87117055, -1.40297864, -3.00319435]]))]
Unless I’m interpreting it incorrectly, the array piece that looks like this:
((array([[ 2.2644603 , 1.09971298, 0. , 1.54036335],
[ 6.33722569, 0. , 0. , 4.48582383],
[10.37508342, 0. , 1.63635185, 8.17870169]]),
…is the one I need to use in my final sigmoid function. But that part of the list doesn’t get appended until the third loop happens. So how do I get the output of the third loop without running the third loop?