docstr: Test the pB_info_gain function. Demonstrates operation
  by manipulating shape of the Dirichlet priors over likelihood parameters
  (pB), which affects information gain for different states
docstr_tok: ["Test","the","pB_info_gain","function",".","Demonstrates","operation","by","manipulating","shape","of","the","Dirichlet","priors","over","likelihood","parameters","(","pB",")",",","which","affects","information","gain","for","different","states"]
code: def test_pB_info_gain(self):
      """
      Test the pB_info_gain function. Demonstrates operation
      by manipulating shape of the Dirichlet priors over likelihood parameters
      (pB), which affects information gain for different states
      """
      num_states = [2]
      num_controls = [2]
  
      # start with a precise initial state
      qs = utils.to_obj_array(utils.onehot(0, num_states[0]))
  
      B = utils.construct_controllable_B(num_states, num_controls)
  
      pB = utils.obj_array_ones(
          [[num_states[0], num_states[0], num_controls[0]]]
      )
  
      # create prior over dirichlets such that there is a skew
      # in the parameters about the likelihood mapping from the
      # hidden states to hidden states under the second action,
      # such that hidden state 0 is considered to be more likely than the other,
      # given the action in question
      # Therefore taking that action would yield an expected state that afford
      # high information gain about that part of the likelihood distribution.
      #
      pB[0][0, :, 1] += 1.0
  
      # single timestep
      n_step = 1
      policies = control.construct_policies(
          num_states, num_controls, policy_len=n_step
      )
  
      pB_info_gains = np.zeros(len(policies))
      for idx, policy in enumerate(policies):
          qs_pi = control.get_expected_states(qs, B, policy)
          pB_info_gains[idx] += control.calc_pB_info_gain(
              pB, qs_pi, qs, policy
          )
      self.assertGreater(pB_info_gains[1], pB_info_gains[0])
  
imports: import os
  import unittest
  import numpy
  from pymdp import utils, maths
  from pymdp import control
label_desc: Use image node_id 6 for calling the TestControl obj's underlying member method code with example usage: obj.test_pB_info_gain() without return types