-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QR-decomposition fails on a specific matrix. #1058
Comments
The bug is in linalg_ops.ts:214:
However, it would be desirable to have positive diagonal for the resulting R and the sign selected accordingly. |
@jarno-r Do you want to send us a PR (to https://github.com/tensorflow/tfjs-core) to fix the issue? |
tensorflow/tfjs#1058 Use packed matmul program always, in batchMatMul and fusedMatMul. Remove non packed mat mul implementation. Modified [matmul benchmark](https://gist.github.com/astojilj/b6cc855e708bb2d77c7f892ef8489137) shows performance improvement for matmul of tensors with shape [3, 400, 400] and [3, 1000, 1000]: master: "N=400": { "averageTimeMs": 25.751999999629334 }, "N=1000": { "averageTimeMs": 140.3969999976107 } with this patch: "N=400": { "averageTimeMs": 9.409999999043066 }, "N=1000": { "averageTimeMs": 54.652999998943415 } Benchmark run on discrete GPU on [ASUS ROG-GL702VM](https://www.asus.com/Laptops/ROG-GL702VM-7th-Gen-Intel-Core/)
PERF tensorflow/tfjs#1058 Use packed matmul program always, in batchMatMul and fusedMatMul. Remove non packed mat mul implementation. Modified [matmul benchmark](https://gist.github.com/astojilj/b6cc855e708bb2d77c7f892ef8489137) shows performance improvement for matmul of tensors with shape [3, 400, 400] and [3, 1000, 1000]: master: "N=400": { "averageTimeMs": 25.751999999629334 }, "N=1000": { "averageTimeMs": 140.3969999976107 } with this patch: "N=400": { "averageTimeMs": 9.409999999043066 }, "N=1000": { "averageTimeMs": 54.652999998943415 } Benchmark run on discrete GPU on [ASUS ROG-GL702VM](https://www.asus.com/Laptops/ROG-GL702VM-7th-Gen-Intel-Core/)
tensorflow/tfjs#1058 The sign() function returns 0 on 0, which causes a division by zero in the QR decomposition function qr() if there is a zero on the diagonal. BUG
Fixed in tensorflow/tfjs-core#1473 |
To get help from the community, check out our Google group.
TensorFlow.js version
0.14.1
Browser version
Node.js v8.12.0 without tfjs-node.
Describe the problem or feature request
QR decomposition returns NaNs for the invertible matrix [[0,2,2],[1,1,1],[0,1,2]], but works for some other matrices.
Code to reproduce the bug
The text was updated successfully, but these errors were encountered: