projects
/
culture.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4824852
)
Update.
author
François Fleuret
<francois@fleuret.org>
Thu, 4 Jul 2024 11:34:09 +0000
(14:34 +0300)
committer
François Fleuret
<francois@fleuret.org>
Thu, 4 Jul 2024 11:34:09 +0000
(14:34 +0300)
quizz_machine.py
patch
|
blob
|
history
diff --git
a/quizz_machine.py
b/quizz_machine.py
index
f00bf9e
..
c5da586
100755
(executable)
--- a/
quizz_machine.py
+++ b/
quizz_machine.py
@@
-328,6
+328,14
@@
class QuizzMachine:
)
if self.back_accuracy:
)
if self.back_accuracy:
+ # If back_accuracy is True, we compute the accuracy on
+ # the backward quizzes not by counting how many time
+ # the real prompt A is equal to the reconstructed
+ # prompt A*, but how many time the answers B* computed
+ # from A* is equal to the correct answer. So we look
+ # for the accuracy of A->B*=B for the forward, but for
+ # the backward we look at B->A*->B*=B instead of B->A*=A
+
n_forward = input[:, 0] == self.token_forward
nb_total = input[n_forward].size(0)
nb_correct = (
n_forward = input[:, 0] == self.token_forward
nb_total = input[n_forward].size(0)
nb_correct = (