No torch gradient with respect to the gamma shape parameter

Open Beginner friendly
#146 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python, pytorch

Research direction

Start with docs/special_functions_audit.md and check how its torch gradient results are recorded for the incomplete gamma functions. The issue demonstrates the limitation with sr.crps_gamma and a gradient with respect to shape; clarify that the reported PASS applies only to the second argument. Done when the audit accurately describes this limitation.

Written by the indexing model from the issue text.

Description

backend:torch bug documentation

torch's gammainc has no derivative with respect to its first argument, so for example crps_gamma cannot be differentiated with respect to shape on torch.

a = torch.tensor(2.0, dtype=torch.float64, requires_grad=True)
sr.crps_gamma(torch.tensor(1.5, dtype=torch.float64), a, torch.tensor(1.0, dtype=torch.float64)).backward()
# NotImplementedError: the derivative for 'igamma: input' is not implemented.

docs/special_functions_audit.md lists the incomplete gamma functions as torch grad PASS, which only holds for the second argument. At minimum the doc should say so.

Dominant language
Python
Stars
108
Forks
15
Avg merge
1h 42m
Merged PRs (30d)
9

Getting set up

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.

More from frazane/scoringrules

All issues in frazane/scoringrules

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.