def set_data(self): self.content = {} self.target = {} for i in range(self.total_len): val = random.randrange(self.base) self.content[ha(np.array([i]))] = val self.target[i] = val self.total_reward = self.total_len
def set_data(self): self.total_len = len(self.input_data_string) self.content = {} self.target = {} for i in range(self.total_len): self.content[ha(np.array([i]))] = ord(self.input_data_string[i])-ord('a') self.target[i] = ord(self.output_data_string[i]) - ord('a') self.total_reward = self.total_len
def set_data(self): self.content = {} self.target = {} for i in range(self.total_len): val = self.np_random.randint(self.base) self.content[ha(np.array([i]))] = val self.target[self.total_len - i - 1] = val self.total_reward = self.total_len + 0.9
def set_data(self): self.total_len = len(self.input_data_string) self.content = {} self.target = {} for i in range(self.total_len): self.content[ha(np.array( [i]))] = ord(self.input_data_string[i]) - ord('a') self.target[i] = ord(self.output_data_string[i]) - ord('a') self.total_reward = self.total_len
def set_data(self): self.content = {} self.target = {} copies = int(self.total_len / self.duplication) for i in range(copies): val = random.randrange(self.base) self.target[i] = val for d in range(self.duplication): self.content[ha(np.array([i * self.duplication + d]))] = val self.total_reward = self.total_len / self.duplication
def set_data(self): self.content = {} self.target = {} unique = set() for i in range(self.total_len): val = random.randrange(self.base) self.content[ha(np.array([i]))] = val self.target[i] = val self.target[2 * self.total_len - i - 1] = val self.target[2 * self.total_len + i] = val self.total_reward = 3.0 * self.total_len + 0.9
def set_data(self): self.content = {} self.target = {} curry = 0 for i in range(self.total_len): vals = [] for k in range(self.rows): val = self.np_random.randint(self.base) self.content[ha(np.array([i, k]))] = val vals.append(val) total = sum(vals) + curry self.target[i] = total % self.base curry = total / self.base if curry > 0: self.target[self.total_len] = curry self.total_reward = self.total_len
def set_data(self): self.content = {} self.target = {} len_left = self.total_len i = 0 while len_left > 0: rand_len = self.np_random.randint(1, min(len_left, MAX_LEN) + 1) if not LEN_TO_WORD[rand_len]: continue encoded = self.np_random.choice(LEN_TO_WORD[rand_len]) for c in encoded: enc_val = ord(c) - ord('a') dec_val = ord(this.d[c]) - ord('a') self.content[ha(np.array([i]))] = enc_val self.target[i] = dec_val i += 1 len_left -= rand_len self.total_reward = self.total_len