code: def calc_reward_fn(self):
          
          model = copy.copy(self.model)
          model.train(self.dataset)
  
          # reward function: Importance-Weighted-Accuracy (IW-ACC) (tau, f)
          reward = 0.
          for i in range(len(self.queried_hist_)):
              reward += self.W[i] * (
                  model.predict(
                      self.dataset.data[
                          self.queried_hist_[i]][0].reshape(1, -1)
                      )[0] ==
                  self.dataset.data[self.queried_hist_[i]][1]
              )
          reward /= (self.dataset.len_labeled() + self.dataset.len_unlabeled())
          reward /= self.T
          return reward
docs: Calculate the reward value