def load_stats(self, subdir, pref=""): cost = util.load("statsNNcost", subdir, pref) n = len(cost) n_cost, n_v_cost = cost[0:n // 2], cost[n // 2:n] self.stat_error_cost = [x for x in n_cost.T] self.stat_val_error_cost = [x for x in n_v_cost.T]
def load_dataset(self, subdir, pref=""): fname = "dataset_" + pref self.logger.debug("Loading dataset from %s (%s)", fname, subdir) steps_history_state = [s for s in util.load(fname, subdir, suffix="S")] steps_history_action = [a for a in util.load(fname, subdir, suffix="A")] steps_history_target = [t for t in util.load(fname, subdir, suffix="t")] self.logger.debug("Filtering!") self. steps_history_state, self.steps_history_action, self.steps_history_target = [], [], [] sum = 0 absum = 0 for S, a, t in zip(steps_history_state, steps_history_action, steps_history_target): #TODO: move to coindrop if t < -0.899 or t > 0.899: #self.logger.debug("%0.2f target for action %d on:\n%s", t, a, S) sum += t absum += 1 self.steps_history_state.append(S) self.steps_history_action.append(a) self.steps_history_target.append(t) self.logger.debug("%d sum, out of %d", sum, absum)
def load_stats(self, subdir, pref=""): self.stats_G = util.load("statsG", subdir, pref).tolist()
def load_episode_history(self, fname, subdir): self.logger.debug("Loading episode history from %s %s", subdir, fname) self.episodes_history = [[(s[0], s[1], s[2]) for s in sh] for sh in util.load(fname, subdir, suffix="EH")] self.test_episodes_history = [[(s[0], s[1], s[2]) for s in sh] for sh in util.load(fname, subdir, suffix="VEH")]
def load_stats(self, subdir, pref=""): self.fa.load_stats(subdir, pref) self.stats_abs_delta = util.load("statsDelta", subdir, pref)[()]
def load_hists(self, subdir): # TODO: figure out what exactly we want to store/load A = util.load("valuehistory", subdir).tolist() self.all_currs, self.all_targets, self.all_deltas = A[0], A[1], A[2]
def load_model(self, load_subdir, pref=""): self.logger.debug("Loading Q from: %s", load_subdir) self.Q = util.load(pref + "Q", load_subdir)