docstr: Test the pA_info_gain function. Demonstrates operation
  by manipulating shape of the Dirichlet priors over likelihood parameters
  (pA), which affects information gain for different expected observations
docstr_tok: ["Test","the","pA_info_gain","function",".","Demonstrates","operation","by","manipulating","shape","of","the","Dirichlet","priors","over","likelihood","parameters","(","pA",")",",","which","affects","information","gain","for","different","expected","observations"]
code: def test_pA_info_gain(self):
      """
      Test the pA_info_gain function. Demonstrates operation
      by manipulating shape of the Dirichlet priors over likelihood parameters
      (pA), which affects information gain for different expected observations
      """
  
      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)
  
      # single timestep
      n_step = 1
      policies = control.construct_policies(
          num_states, num_controls, policy_len=n_step
      )
  
      # single observation modality
      num_obs = [2]
  
      # create noiseless identity A matrix
      A = utils.to_obj_array(np.eye(num_obs[0]))
  
      # create prior over dirichlets such that there is a skew
      # in the parameters about the likelihood mapping from the
      # second hidden state (index 1) to observations, such that
      # Observation 0 is believed to be more likely than the other, conditioned on State 1.
      # Therefore sampling observations conditioned on State 1 would afford high info gain
      # about parameters, for that part of the likelhood distribution.
  
      pA = utils.obj_array_ones([[num_obs[0], num_states[0]]])
      pA[0][0, 1] += 1.0
  
      pA_info_gains = np.zeros(len(policies))
      for idx, policy in enumerate(policies):
          qs_pi = control.get_expected_states(qs, B, policy)
          qo_pi = control.get_expected_obs(qs_pi, A)
          pA_info_gains[idx] += control.calc_pA_info_gain(
              pA, qo_pi, qs_pi
          )
  
      self.assertGreater(pA_info_gains[1], pA_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 5 for calling the TestControl obj's underlying member method code with example usage: obj.test_pA_info_gain() without return types