8000 logsumexp with subtraction · Issue #32097 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content
logsumexp with subtraction #32097
@fuzic

Description

@fuzic

🚀 Feature

scikit's implementation of logsumexp accepts a supplemental array of scaling factors that allow for subtraction instead of just addition.
https://docs.scipy.org/doc/scipy-0.19.0/reference/generated/scipy.misc.logsumexp.html

Motivation

I'm doing work with log probabilities and need to subtract some likelihoods from each other. Currently I have to move to linear probabilities first.

Pitch

If logsumexp is operating over a dimension of size N, accept an additional tensor of size (N,) of scaling factors, to match the functionality in scikit
https://docs.scipy.org/doc/scipy-0.19.0/reference/generated/scipy.misc.logsumexp.html

Alternatives

subtraction of probabilities in linear space, but this has numerical stability issues obviously.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureA request for a proper, new feature.module: reductionstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0