micropython-ulab icon indicating copy to clipboard operation
micropython-ulab copied to clipboard

SVD unittests

Open EmDash00 opened this issue 1 year ago • 2 comments

EmDash00 avatar Jul 16 '24 21:07 EmDash00

Getting an odd bug on one of my unittests where one of the prints causes them to crash.

https://github.com/EmDash00/micropython-ulab/blob/5587d4e69dd7e635d5e6223aabc7019057631d2d/tests/2d/scipy/svd.py#L94

A = rng.random((15, 10))
U, S, Vh = sp.linalg.svd(A)
# print(np.dot(U * S, Vh))
B = np.dot(np.dot(U, S), Vh)
print("15x10 Random Compare:", np.max(abs(A - B)) < tol)
print()

I'm not sure why it doesn't like the print line. All the other prints in the unittest seem fine.

Either way most of the them appear to fail. Not sure why. It's likely some bug in the internal implementation. I'm currently assuming the S matrix output is 2D; however, it would be good to make it 1D. I have adjusted test cases for those already written, but they're commented out.

EmDash00 avatar Jul 16 '24 21:07 EmDash00

OK, thanks, I'll take a look.

v923z avatar Jul 21 '24 16:07 v923z