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
Calculate the reward value
dataset/ETHPy150Open ntucllab/libact/libact/query_strategies/active_learning_by_learning.py/ActiveLearningByLearning.calc_reward_fn