From: François Fleuret Date: Sun, 24 Mar 2024 10:33:35 +0000 (+0100) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=3168a3161668caacb36ebd717e308e36c9eef2b1;p=picoclvr.git Update. --- diff --git a/tasks.py b/tasks.py index dba6e13..0f80d4f 100755 --- a/tasks.py +++ b/tasks.py @@ -1887,7 +1887,7 @@ class Escape(Task): states, actions, rewards = escape.generate_episodes( nb_train_samples + nb_test_samples, height, width, T ) - seq = escape.episodes2seq(states, actions, rewards) + seq = escape.episodes2seq(states, actions, rewards, lookahead_delta=5) self.train_input = seq[:nb_train_samples].to(self.device) self.test_input = seq[nb_train_samples:].to(self.device) @@ -1934,8 +1934,12 @@ class Escape(Task): device=self.device, ) - s, a, r = escape.seq2episodes(result, self.height, self.width) - str = escape.episodes2str(s, a, r, unicode=True, ansi_colors=True) + s, a, r, lr = escape.seq2episodes( + result, self.height, self.width, lookahead=True + ) + str = escape.episodes2str( + s, a, r, lookahead_rewards=lr, unicode=True, ansi_colors=True + ) filename = os.path.join(result_dir, f"test_seq_{n_epoch:04d}.txt") with open(filename, "w") as f: