Update.
authorFrançois Fleuret <francois@fleuret.org>
Sun, 24 Mar 2024 10:33:35 +0000 (11:33 +0100)
committerFrançois Fleuret <francois@fleuret.org>
Sun, 24 Mar 2024 10:33:35 +0000 (11:33 +0100)
tasks.py

index dba6e13..0f80d4f 100755 (executable)
--- 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: