projects
/
culture.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ed64a06
)
Update.
author
François Fleuret
<francois@fleuret.org>
Fri, 5 Jul 2024 22:16:49 +0000
(
01:16
+0300)
committer
François Fleuret
<francois@fleuret.org>
Fri, 5 Jul 2024 22:16:49 +0000
(
01:16
+0300)
quizz_machine.py
patch
|
blob
|
history
diff --git
a/quizz_machine.py
b/quizz_machine.py
index
717e8ac
..
c6c2f95
100755
(executable)
--- a/
quizz_machine.py
+++ b/
quizz_machine.py
@@
-360,28
+360,28
@@
class QuizzMachine:
result[n_backward], correct[n_backward] = compute_accuracy(back_input)
if log_prefix is not None:
result[n_backward], correct[n_backward] = compute_accuracy(back_input)
if log_prefix is not None:
- nb_correct = correct[n_forward].sum()
- nb_total = correct[n_forward].size(0)
- back_nb_correct = correct[n_backward].sum()
- back_nb_total = correct[n_backward].size(0)
+
forward_
nb_correct = correct[n_forward].sum()
+
forward_
nb_total = correct[n_forward].size(0)
+ back
ward
_nb_correct = correct[n_backward].sum()
+ back
ward
_nb_total = correct[n_backward].size(0)
self.logger(
self.logger(
- f"
accuracy {log_prefix} {n_epoch} {model.id=} {nb_correct} / {
nb_total}"
+ f"
forward_accuracy {log_prefix} {n_epoch} {model.id=} {forward_nb_correct} / {forward_
nb_total}"
)
self.logger(
)
self.logger(
- f"back
_accuracy {log_prefix} {n_epoch} {model.id=} {back_nb_correct} / {back
_nb_total}"
+ f"back
ward_accuracy {log_prefix} {n_epoch} {model.id=} {backward_nb_correct} / {backward
_nb_total}"
)
return result, correct
compute_accuracy(self.train_w_quizzes[:nmax], log_prefix="train")
)
return result, correct
compute_accuracy(self.train_w_quizzes[:nmax], log_prefix="train")
-
result,
correct = compute_accuracy(
+
test_result, test_
correct = compute_accuracy(
self.test_w_quizzes[:nmax], log_prefix="test"
)
self.test_w_quizzes[:nmax], log_prefix="test"
)
- main_test_accuracy =
correct.sum() /
correct.size(0)
+ main_test_accuracy =
test_correct.sum() / test_
correct.size(0)
self.logger(f"main_test_accuracy {n_epoch} {main_test_accuracy}")
##############################
self.logger(f"main_test_accuracy {n_epoch} {main_test_accuracy}")
##############################
@@
-389,9
+389,9
@@
class QuizzMachine:
self.save_quizzes(
result_dir,
f"culture_prediction_{n_epoch:04d}_{model.id:02d}",
self.save_quizzes(
result_dir,
f"culture_prediction_{n_epoch:04d}_{model.id:02d}",
- quizzes=result[:72],
+ quizzes=
test_
result[:72],
show_to_be_predicted=True,
show_to_be_predicted=True,
- mistakes=correct[:72] * 2 - 1,
+ mistakes=
test_
correct[:72] * 2 - 1,
)
return main_test_accuracy
)
return main_test_accuracy