Skip to content

Add a signed log_sum_exp #2592

@andrjohns

Description

@andrjohns

Description

When using log_sum_exp, it would be useful to be able specify a 'sign' for the variables being aggregated - such that some inputs are added and some subtracted.

I'm currently needing this for the gradients of hyper_pFq function, which are all computed on the log scale and the signs tracked through the infinite sum.

Example

The function would be:

log_sum_exp_signed(input_container, signs_container)

Which would be equivalent to:

log(sum(exp(input_container) .* signs_container))

But with the log_sum_exp approach to avoiding overflow

Current Version:

v4.1.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions