pymc-devs / pymc-devs/pytensor
Use contraction path to optimize `pt.nlinalg.matrix_dot`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 644
- Forks
- 208
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 16
Description
Description
Right now we have a function pt.nlinalg.matrix_dot that is just a helper for doing repeated dot products. This is similar to but worse than np.linalg.multi_dot, because multi_dot also computes an optimal contraction path, and does the dot products in a smart order.
#722 added optimized contraction path logic, so we could include this into our matrix_dot function. While we're at it, we should rename the function to multi_dot to match the numpy API.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating pt.nlinalg.matrix_dot and review the optimized contraction path logic added in #722, then compare its intended behavior with np.linalg.multi_dot. Done means matrix_dot uses an optimal contraction path and is renamed to multi_dot to match the NumPy API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100