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

temperature value t_u #7

Closed nysp78 closed 9 months ago

nysp78 commented 9 months ago

Hello, I wanted to ask why the counterfactual cf_scale is multiplied with a temperature value t_u=0.1 in eval_example.ipynb. Would it be possible to use other t_u values as well? Is there any criterion to determine the best temp value?

t_u=0.1 cf_loc, cf_scale = vae.forward_latents(z, parents=_cf_pa) cf_scale = cf_scale * t_u

Thanks in advance!

fabio-deep commented 9 months ago

Hi, it is just a sampling temperature parameter you can play with, the best value depends on your use case and what you are measuring (e.g. measuring quality vs diversity). When t_z = t_u = 0 the model returns the most likely counterfactual and for anything >0 it'll sample from the counterfactual distribution.