Skip to content

Commit

Permalink
fix a bug for MFI
Browse files Browse the repository at this point in the history
  • Loading branch information
nnnyt committed Oct 28, 2022
1 parent 43caf07 commit a079721
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CAT/strategy/KLI_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MKLIStrategy(KLIStrategy):

def __init__(self):
super().__init__()

@property
def name(self):
return 'Multivariate Kullback-Leibler Information Strategy'
6 changes: 3 additions & 3 deletions CAT/strategy/MFI_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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'

0 comments on commit a079721

Please sign in to comment.