infer-actively / pymdp

A Python implementation of active inference for Markov Decision Processes
MIT License
419 stars 83 forks source link

Choose random action if all action probabilities are the same, even if sampling is deterministic (i.e., some tolerance of probability) #115

Closed conorheins closed 1 year ago

conorheins commented 1 year ago

When action_selection == "determinstic" in control.sample_action(), but all the action probabilities are equal, we should sample rather than deterministically choose the first action (which is the default behavior of np.argmax

conorheins commented 1 year ago

Adressed this here, now closing

conorheins commented 1 year ago

This has been better addressed and dealt with by @AleMuzzi in this pull request, dealing specifically with the case when there is a subset of the total number of actions that have equal probability, deterministic sampling still needs to sample from among them