diff --git a/document/FlashcardDocumentSampler.py b/document/FlashcardDocumentSampler.py index 8a8d872..3cdf9d1 100644 --- a/document/FlashcardDocumentSampler.py +++ b/document/FlashcardDocumentSampler.py @@ -9,6 +9,6 @@ class FlashcardDocumentSampler(document.AbstractDocumentSampler): def sample_document(self): doc_features = {} doc_features['doc_id'] = self._doc_count - doc_features['difficulty'] = self._rng.random_sample((1, 3)) + doc_features['difficulty'] = self._rng.uniform(0, 5, (1, 3)) self._doc_count += 1 return self._doc_ctor(**doc_features) \ No newline at end of file diff --git a/user/FlashcardUserModel.py b/user/FlashcardUserModel.py index 306598a..0ef3e06 100644 --- a/user/FlashcardUserModel.py +++ b/user/FlashcardUserModel.py @@ -52,7 +52,7 @@ class FlashcardUserModel(user.AbstractUserModel): doc_id = doc._doc_id W = self._user_state._W[doc_id] if not W.any(): # uninitialzed - self._user_state._W[doc_id] = W = doc.base_difficulty + np.random.uniform(-0.5, 0.5, (1, 3)) # a uniform error for each user + self._user_state._W[doc_id] = W = doc.base_difficulty * np.random.uniform(0.5, 2.0, (1, 3)) # a uniform error for each user print(W) # use exponential function to simulate whether the user recalls last_review = self._user_state._time - self._user_state._last_review[doc_id]