def R(self,pa,eta):
""" returns the ratio of the probability of the given assignment under each action to the probability under the eta weighted sum of actions. """
Q = (eta*pa).sum()
ratio = np.true_divide(pa,Q)
ratio[np.isnan(ratio)] = 0 # we get nan when 0/0 but should just be 0 in this case
return ratio
评论列表
文章目录