biomedia-mira / causal-gen

(ICML 2023) High Fidelity Image Counterfactuals with Probabilistic Causal Models
https://arxiv.org/abs/2306.15764
MIT License
55 stars 7 forks source link

Gumbel trick implementation #9

Closed nysp78 closed 6 months ago

nysp78 commented 7 months ago

Hello,

x = transform.inv(y) event_dim += transform.domain.event_dim - transform.codomain.event_dim log_prob = log_prob - _sum_rightmost( transform.log_abs_det_jacobian(x, y), event_dim - transform.domain.event_dim, ) y = x

Why is x passed as argument to the method log_abs_det_jacobian? It is supposed that this function takes only one argument.

Also, why does this function implement the abs det jacobian of the gumbel transformation? In which part is p_x(g-1(y)) implemented?

Thanks in advance!