Support python3 and pytorch 0.2

This commit is contained in:
Shangtong Zhang
2017-10-26 23:01:57 -06:00
parent 1b6de16b4f
commit 6682937b54
12 changed files with 33 additions and 28 deletions
+5 -5
View File
@@ -1,5 +1,5 @@
from async_agent import *
from DDPG_agent import *
from DQN_agent import *
from A2C_agent import *
from MSDQN_agent import *
from .async_agent import *
from .DDPG_agent import *
from .DQN_agent import *
from .A2C_agent import *
from .MSDQN_agent import *
+6 -6
View File
@@ -1,6 +1,6 @@
from actor_critic import *
from continuous_actor_critic import *
from n_step_q import *
from one_step_sarsa import *
from one_step_q import *
from ppo import *
from .actor_critic import *
from .continuous_actor_critic import *
from .n_step_q import *
from .one_step_sarsa import *
from .one_step_q import *
from .ppo import *
+5 -5
View File
@@ -1,5 +1,5 @@
from atari_wrapper import *
from policy import *
from replay import *
from task import *
from random_process import *
from .atari_wrapper import *
from .policy import *
from .replay import *
from .task import *
from .random_process import *
+1 -1
View File
@@ -6,7 +6,7 @@
import gym
import sys
import numpy as np
from atari_wrapper import *
from .atari_wrapper import *
class BasicTask:
def __init__(self):
+3 -3
View File
@@ -1,3 +1,3 @@
from conv_network import *
from shallow_network import *
from continuous_action_network import *
from .conv_network import *
from .shallow_network import *
from .continuous_action_network import *
+1 -1
View File
@@ -4,7 +4,7 @@
# declaration at the top #
#######################################################################
from network import *
from .base_network import *
class DeterministicActorNet(nn.Module, BasicNet):
def __init__(self,
+1 -1
View File
@@ -4,7 +4,7 @@
# declaration at the top #
#######################################################################
from network import *
from .base_network import *
# Network for pixel Atari game with value based methods
class NatureConvNet(nn.Module, VanillaNet):
+1 -1
View File
@@ -4,7 +4,7 @@
# declaration at the top #
#######################################################################
from network import *
from .base_network import *
# Network for CartPole with value based methods
class FCNet(nn.Module, VanillaNet):
+6 -5
View File
@@ -1,7 +1,8 @@
from config import *
from normalizer import *
from run import *
from .config import *
from .normalizer import *
from .run import *
try:
from tf_logger import Logger
from .tf_logger import Logger
except:
from vanilla_logger import Logger
from .vanilla_logger import Logger
+2
View File
@@ -3,6 +3,7 @@
import tensorflow as tf
import numpy as np
import scipy.misc
import logging
try:
from StringIO import StringIO # Python 2.7
@@ -18,6 +19,7 @@ class Logger(object):
self.debug = vanilla_logger.debug
self.warning = vanilla_logger.warning
self.skip = skip
logging.info('')
def scalar_summary(self, tag, value, step):
if self.skip:
+2
View File
@@ -1,4 +1,5 @@
import numpy as np
import logging
class Logger(object):
def __init__(self, log_dir, vanilla_logger, skip=False):
@@ -7,6 +8,7 @@ class Logger(object):
self.debug = vanilla_logger.debug
self.warning = vanilla_logger.warning
self.skip = skip
logging.info('')
def scalar_summary(self, tag, value, step):
if self.skip: