From fa294cd53298d4d19f16591a858a9e3f255c7970 Mon Sep 17 00:00:00 2001 From: Shangtong Zhang Date: Mon, 7 May 2018 21:24:52 -0600 Subject: [PATCH] Fix import --- deep_rl/network/network_utils.py | 1 + deep_rl/utils/plot.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deep_rl/network/network_utils.py b/deep_rl/network/network_utils.py index 79d6fb2..3a54b7b 100644 --- a/deep_rl/network/network_utils.py +++ b/deep_rl/network/network_utils.py @@ -7,6 +7,7 @@ import torch import torch.nn as nn import torch.nn.functional as F +import numpy as np class BaseNet: def set_gpu(self, gpu): diff --git a/deep_rl/utils/plot.py b/deep_rl/utils/plot.py index 0869174..690c0c0 100644 --- a/deep_rl/utils/plot.py +++ b/deep_rl/utils/plot.py @@ -1,7 +1,7 @@ # Adapted from https://github.com/openai/baselines/blob/master/baselines/results_plotter.py +from ..component.bench import load_monitor_log import numpy as np -from ..component import * import os import re @@ -44,7 +44,7 @@ class Plotter: def load_results(self, dirs, max_timesteps=1e8, x_axis=X_TIMESTEPS, episode_window=100): tslist = [] for dir in dirs: - ts = component.load_monitor_log(dir) + ts = load_monitor_log(dir) ts = ts[ts.l.cumsum() <= max_timesteps] tslist.append(ts) xy_list = [self.ts2xy(ts, x_axis) for ts in tslist]