From a0797210da1924ffd071a70a563111e191d8bbda Mon Sep 17 00:00:00 2001 From: nnnyt <793313994@qq.com> Date: Fri, 28 Oct 2022 21:05:16 +0800 Subject: [PATCH] fix a bug for MFI --- CAT/strategy/KLI_strategy.py | 2 +- CAT/strategy/MFI_strategy.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CAT/strategy/KLI_strategy.py b/CAT/strategy/KLI_strategy.py index f1bffb1..c298b02 100644 --- a/CAT/strategy/KLI_strategy.py +++ b/CAT/strategy/KLI_strategy.py @@ -34,7 +34,7 @@ class MKLIStrategy(KLIStrategy): def __init__(self): super().__init__() - + @property def name(self): return 'Multivariate Kullback-Leibler Information Strategy' \ No newline at end of file diff --git a/CAT/strategy/MFI_strategy.py b/CAT/strategy/MFI_strategy.py index fffd77c..136b032 100644 --- a/CAT/strategy/MFI_strategy.py +++ b/CAT/strategy/MFI_strategy.py @@ -26,7 +26,7 @@ def adaptest_select(self, model: AbstractModel, adaptest_data: AdapTestDataset): 'the models must implement get_pred method for accelerating' pred_all = model.get_pred(adaptest_data) if self.I is None: - self.I = [np.zeros((model.model.num_dim, model.model.num_dim))] * adaptest_data.num_students + self.I = [np.zeros((model.model.num_dim, model.model.num_dim)) for _ in range(adaptest_data.num_students)] selection = {} n = len(adaptest_data.tested[0]) for sid in range(adaptest_data.num_students): @@ -41,11 +41,11 @@ def adaptest_select(self, model: AbstractModel, adaptest_data: AdapTestDataset): selection[sid] = untested_questions[j] self.I[sid] += untested_fisher[j] return selection - + class DoptStrategy(MFIStrategy): def __init__(self): super().__init__() - + @property def name(self): return 'D-Optimality Strategy' \ No newline at end of file