Welcome to pymdp Discussions! #4
Replies: 4 comments 9 replies
-
Thank you for creating the library and groundwork to bring the Active Inference to the Python environment. I have a few points on the Grid World example. As you use identity for the likelihood matrix (A), the uncertainty calculation (entropy.dot(Qs_pi)) value is always zero. This means there is no ambiguity at all. But, your algorithm still "looks as" it's doing an exploration. This is due to the random. multinomial(), where it always pick any random policy, where it seems to us that it's doing more like exploration. But actually, it's not. It's more like a Brownian motion. When the observation is getting close to the preference, the probability of getting an action policy resulting in the matching observation increases. But the exploration that we see is not due to uncertainty, which is one of the core concepts in FEP. Another point is that when you evaluate the expected FEP of a policy by integrating over its actions, you keep the same best_guess belief distribution (Qs) constant. I think you should update the Qs distribution after each action using something similar to Qs = maths.softmax(log_stable(Qo_pi) + log_stable(Qs_pi)). I think this is important. Lastly, it seems to me, the method you use to select the best action is not purely based on the best policy. You sum the normalized expected FEP's of a certain action over all policies and then select the action. But, if you update the best guess belief distribution when calculating the expected FEP (like I mentioned above), you can directly pick the first action of the best policy. I notice that using this method, the agent finds the preference observation quickly. But, ergodicity is low as no exploration due to the identity matrix used for the likelihood (i.e. no ambiguity). Let's explore other ways to bring ambiguity to the algorithm, rather than using Python's "random" functions. Thank you~ Yasas Ponweera |
Beta Was this translation helpful? Give feedback.
-
In line 95 of agent.py assert utils.is_normalized(self.B), "A matrix is not normalized (i.e. A.sum(axis = 0) must all equal 1.0" I believe this is an error, as it should be the B matrix not the A matrix. |
Beta Was this translation helpful? Give feedback.
-
Hi, The specific things I was wondering are
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
👋 Welcome!
Here is a discussion thread where we can discuss things like issues, bugs, and ideas for extensions that relate to the
pymdp
package.Beta Was this translation helpful? Give feedback.
All reactions