pymc-devs / pymc-devs/pytensor

Rewrite `argmax(f(x)` -> argmax(x)` for monotonic f

Open
#1,851 9 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

graph rewriting
Dominant language
Python
Stars
644
Forks
208
Avg merge
2d 14h
Merged PRs (30d)
16

Description

Description

Similarly max(f(x)) -> f(max(x))

We can also convert (arg)max to (arg)min for monotonic decreasing functions

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name an implementation file, test, or entry point. Start by locating PyTensor's graph-rewrite handling for argmax, max, and monotonic functions, then determine the supported transformation rules and add coverage showing the rewrites for increasing and decreasing functions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.