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
Pinv numpy backend #918
base: master
Are you sure you want to change the base?
Pinv numpy backend #918
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also add pinv
to all other backends, or raise a NotImplementedError
,
and add tests for each function. Thanks!
Returns: | ||
tensor: The pseudo inverse of tensor. | ||
""" | ||
return np.linalg.pinv(tensor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use the tensorflow version here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi.
In a StackOverflow article someone has mentioned that the Tensorflow version doesn't work for complex matrices and that's why I went with the Numpy Version.
So shall I still use the Tensorflow version only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please use tensorflow. The point here is to use backend-native operations.
This is done with respect to issue: #844
pinv
function is added totensornetwork/backends/tensorflow/numpy_backend.py
The
pinv
function has been referred from https://numpy.org/doc/stable/reference/generated/numpy.linalg.pinv.htmlPlease do have a look and let me know if should make any other change.
Thank you.