change weights for document and user

This commit is contained in:
2023-10-29 17:21:42 +08:00
parent b4a71cd8e4
commit 5d87afdcc0
2 changed files with 2 additions and 2 deletions

View File

@@ -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]