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

Slogdet returns naive expression and is optimized later #1041

Merged
merged 16 commits into from
Nov 17, 2024

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.

@tanish1729 tanish1729 force-pushed the slogdet-generalisation branch from 6b46ffd to 968dd7c Compare October 31, 2024 08:45
@tanish1729 tanish1729 marked this pull request as ready for review November 1, 2024 12:26
@tanish1729 tanish1729 force-pushed the slogdet-generalisation branch from 164f094 to 816cc77 Compare November 1, 2024 12:29
@tanish1729 tanish1729 force-pushed the slogdet-generalisation branch from 906fbb0 to 8f6badf Compare November 14, 2024 20:34
@ricardoV94
Copy link
Member

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

Copy link

codecov bot commented Nov 16, 2024

Codecov Report

Attention: Patch coverage is 94.59459% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.12%. Comparing base (33a4d48) to head (398f4ad).
Report is 92 commits behind head on main.

Files with missing lines Patch % Lines
pytensor/tensor/rewriting/linalg.py 93.93% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1041      +/-   ##
==========================================
+ Coverage   82.11%   82.12%   +0.01%     
==========================================
  Files         183      183              
  Lines       47959    47978      +19     
  Branches     8635     8642       +7     
==========================================
+ Hits        39381    39403      +22     
+ Misses       6411     6408       -3     
  Partials     2167     2167              
Files with missing lines Coverage Δ
pytensor/tensor/nlinalg.py 94.87% <100.00%> (+0.03%) ⬆️
pytensor/tensor/rewriting/linalg.py 93.28% <93.93%> (+1.90%) ⬆️

... and 1 file with indirect coverage changes

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.

Small details in the docstring rest looks great

@ricardoV94 ricardoV94 merged commit bad8d20 into pymc-devs:main Nov 17, 2024
61 of 62 checks passed
@ricardoV94 ricardoV94 changed the title Added alternative slogdet to return sign and logdet of det op Slogdet returns naive expression and is optimized later Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimizations for Det should also apply to SlogDet
2 participants