mazpie / contrastive-aif

[NeurIPS 2021] Contrastive learning formulation of the active inference framework, for matching visual goal states.
https://contrastive-aif.github.io/
MIT License
9 stars 1 forks source link

Should predicted observations be used for computing intrinsic value term in the likelihood AIF? #1

Open sai-prasanna opened 4 months ago

sai-prasanna commented 4 months ago

I noticed that you use preferred observations for computing the intrinsic value term in the likelihood AIF. But from what I understand the preferred observations should be used only for the extrinsic value term.

https://github.com/mazpie/contrastive-aif/blob/980e386400dccc56f8879e3aa866d98a869364f9/agents.py#L326

image

mazpie commented 4 months ago

Hi @sai-prasanna,

thanks for noting this bug in the public version of the code! I checked the original repo, and the code looks like this:

# compute intrinsic value
embed = self.obs_encoder(predicted_obs)
_, posterior_states = self.posterior(embed, actions, prior_states, is_init=True)

I currently have no time to re-test this version with the change myself, so I may do it later in the future. If you are currently working with the repo, it would be great if you could test it and contribute the fix yourself!