Skip to content
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

Added alternative slogdet to return sign and logdet of det op #1041

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

tanish1729
Copy link
Contributor

@tanish1729 tanish1729 commented Oct 19, 2024

Description

Changing slogdet so that we are able to use the rewrites made for Det

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pytensor--1041.org.readthedocs.build/en/1041/

Copy link
Member

@ricardoV94 ricardoV94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need a specialization rewrite that introduces slogdet as a replacement for log(abs(det(x))) and its sign.

I guess we can also do it without the abs.

This should be before we remove useless Blockwise.

pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
@tanish1729 tanish1729 marked this pull request as ready for review November 1, 2024 12:26
pytensor/tensor/nlinalg.py Outdated Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
tests/tensor/rewriting/test_linalg.py Show resolved Hide resolved
tests/tensor/rewriting/test_linalg.py Outdated Show resolved Hide resolved
tests/tensor/rewriting/test_linalg.py Show resolved Hide resolved
tests/tensor/rewriting/test_linalg.py Show resolved Hide resolved
pytensor/tensor/rewriting/linalg.py Outdated Show resolved Hide resolved
@ricardoV94
Copy link
Member

@tanish1729 changes are shaping up nicely. I think one more round and we're there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimizations for Det should also apply to SlogDet
2 participants