class Task:
- def batches(self, split="train"):
+ def batches(self, split="train", nb_to_use=-1, desc=None):
pass
def vocabulary_size(self):
self.train_input = self.tensorize(self.train_descr)
self.test_input = self.tensorize(self.test_descr)
- def batches(self, split="train"):
+ def batches(self, split="train", nb_to_use=-1, desc=None):
assert split in {"train", "test"}
input = self.train_input if split == "train" else self.test_input
for batch in tqdm.tqdm(
self.t_nul = self.token2id["#"]
self.t_true = self.token2id["true"]
self.t_false = self.token2id["false"]
- self.t_pipe = self.token2id["|"]
+ # self.t_pipe = self.token2id["|"]
# Tokenize the train and test sets
self.train_input = self.str2tensor(self.train_descr)
None if len(self.play_descr) == 0 else self.str2tensor(self.play_descr)
)
- def batches(self, split="train"):
+ def batches(self, split="train", nb_to_use=-1, desc=None):
assert split in {"train", "test"}
input = self.train_input if split == "train" else self.test_input
for batch in tqdm.tqdm(
self.nb_codes = max(self.train_input.max(), self.test_input.max()) + 1
- def batches(self, split="train"):
+ def batches(self, split="train", nb_to_use=-1, desc=None):
assert split in {"train", "test"}
input = self.train_input if split == "train" else self.test_input
for batch in tqdm.tqdm(
progress_bar_desc=None,
)
warnings.warn("keeping thinking snapshots", RuntimeWarning)
- snapshots.append(result[:10].detach().clone())
+ snapshots.append(result[:100].detach().clone())
# Generate iteration after iteration
# Set the lookahead_reward to UNKNOWN for the next iterations
result[
:, u + self.world.index_lookahead_reward
- ] = self.world.lookahead_reward2code(gree.REWARD_UNKNOWN)
+ ] = self.world.lookahead_reward2code(greed.REWARD_UNKNOWN)
filename = os.path.join(result_dir, f"test_thinking_compute_{n_epoch:04d}.txt")
with open(filename, "w") as f:
- for n in range(10):
+ for n in range(snapshots[0].size(0)):
for s in snapshots:
lr, s, a, r = self.world.seq2episodes(
s[n : n + 1],