projects
/
culture.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update.
[culture.git]
/
main.py
diff --git
a/main.py
b/main.py
index
3b5a7c6
..
ee4e9e5
100755
(executable)
--- a/
main.py
+++ b/
main.py
@@
-183,8
+183,8
@@
for n in vars(args):
######################################################################
if args.check:
######################################################################
if args.check:
- args.nb_train_samples = 2500
- args.nb_test_samples = 100
+ args.nb_train_samples = 2500
0
+ args.nb_test_samples = 100
0
if args.physical_batch_size is None:
args.physical_batch_size = args.batch_size
if args.physical_batch_size is None:
args.physical_batch_size = args.batch_size
@@
-338,11
+338,13
@@
def create_quizzes(
desired_average_logits=None,
):
kept = []
desired_average_logits=None,
):
kept = []
- nb_generated_tokens, sum_logits = 0, 0
+
+ sum_logits = 0
while sum([x.size(0) for x in kept]) < nb_for_train + nb_for_test:
nb_to_generate = 4 * (nb_for_train + nb_for_test)
while sum([x.size(0) for x in kept]) < nb_for_train + nb_for_test:
nb_to_generate = 4 * (nb_for_train + nb_for_test)
- new_quizzes, nb_correct, average_logits = task.create_new_quizzes(
+
+ new_quizzes, nb_correct, _sum_logits = task.create_new_quizzes(
n_epoch=n_epoch,
result_dir=args.result_dir,
logger=log_string,
n_epoch=n_epoch,
result_dir=args.result_dir,
logger=log_string,
@@
-352,8
+354,7
@@
def create_quizzes(
desired_average_logits=desired_average_logits,
)
desired_average_logits=desired_average_logits,
)
- nb_generated_tokens += new_quizzes.numel()
- sum_logits += average_logits * new_quizzes.numel()
+ sum_logits += _sum_logits
to_keep = new_quizzes[nb_correct == len(other_models) - 1]
log_string(
to_keep = new_quizzes[nb_correct == len(other_models) - 1]
log_string(
@@
-373,7
+374,7
@@
def create_quizzes(
log_string,
)
log_string,
)
- return sum_logits / n
b_generated_tokens
+ return sum_logits / n
ew_quizzes.size(0)
######################################################################
######################################################################
@@
-409,13
+410,13
@@
nb_new_quizzes_for_test = 100
if args.check:
accuracy_to_make_quizzes = 0.0
if args.check:
accuracy_to_make_quizzes = 0.0
- nb_new_quizzes_for_train = 10
+ nb_new_quizzes_for_train = 10
0
nb_new_quizzes_for_test = 10
desired_average_logits = None
for n_epoch in range(args.nb_epochs):
nb_new_quizzes_for_test = 10
desired_average_logits = None
for n_epoch in range(args.nb_epochs):
- log_string(f"--- epoch {n_epoch
+1
} ----------------------------------------")
+ log_string(f"--- epoch {n_epoch} ----------------------------------------")
a = [(model.id, float(model.main_test_accuracy)) for model in models]
a.sort(key=lambda p: p[0])
a = [(model.id, float(model.main_test_accuracy)) for model in models]
a.sort(key=lambda p: p[0])