Theano Question: Looping through tensor • /r/MachineLearning
It is using broadcasting - numpy will make the dims match using this (read up on numpy broadcasting if you don't know how that works). Theano behaves in the same way. The downside to the broadcasting approach is that it generally uses a lot of intermediate memory since each 2D MxN matrix becomes MxMxN before then being combined and summed over N to get MxM distance calculations for M datapoints. However, it can be very fast (though I think the trick /u/NasenSpray linked is faster generally) if the intermediate memory usage is acceptable.
Apr-4-2016, 18:05:48 GMT
- Technology: