Numpy matrix multiplication instability across rows
stackoverflow.com
stackoverflow.com
Issues like these are paradoxically usually easier to resolve when developing in C/C++, where you usually always have the debugging infrastructure at your fingertips, and everything (at least above the kernel) is readily inspectable. Developing in Python, libraries like numpy starts feeling more like black boxes.