From: François Fleuret Date: Sat, 8 Jul 2023 11:59:28 +0000 (+0200) Subject: Update. X-Git-Url: https://ant.fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=e244104e7b697b79e8500b5d648ec161c4ed9a63;p=picoclvr.git Update. --- diff --git a/expr.py b/expr.py index e539fcb..7b31b8c 100755 --- a/expr.py +++ b/expr.py @@ -44,6 +44,7 @@ def random_expr(variables, budget): def generate_program(nb_variables, length): s = "" variables = set() + length = min(length, 1+torch.randint(length*2, (1,)).item()) while len(s) < length: v = random_var(nb_variables=nb_variables) s += v + "=" + random_expr(variables, budget=20) + ";" @@ -86,7 +87,7 @@ if __name__ == "__main__": import time start_time = time.perf_counter() - sequences = generate_sequences(1000, length=30) + sequences = generate_sequences(1000, length=40) end_time = time.perf_counter() for s in sequences[:10]: print(s) diff --git a/main.py b/main.py index 56b7e1c..e2b705d 100755 --- a/main.py +++ b/main.py @@ -125,7 +125,7 @@ parser.add_argument("--stack_fraction_values_for_train", type=float, default=0.7 parser.add_argument("--expr_nb_variables", type=int, default=5) -parser.add_argument("--expr_sequence_length", type=int, default=30) +parser.add_argument("--expr_sequence_length", type=int, default=40) parser.add_argument("--expr_input_file", type=str, default=None) diff --git a/tasks.py b/tasks.py index 463d94c..cec6704 100755 --- a/tasks.py +++ b/tasks.py @@ -911,7 +911,7 @@ class Expr(Task): test_nb_correct, test_nb_delta, test_nb_missed, - ) = compute_nb_correct(self.test_input[:1000]) + ) = compute_nb_correct(self.test_input[:10000]) logger( f"accuracy_test {n_epoch} nb_total {test_nb_total} nb_correct {test_nb_correct} accuracy {(100.0*test_nb_correct)/test_nb_total:.02f}%"