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) + ";"
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)
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)
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}%"