Example #1
0
 def test_no_enemies_ppo2(self):
     print('testing test_no_enemies_ppo2')
     seed = 42
     path = 'models/AmidarToyboxNoFrameskip-v4.regress.model'
     # # You need to do this if you want to load more than one model with tensorflow
     with tf.Session(graph=tf.Graph()):
         model = oai.getModel(self.env, 'ppo2', seed, path)
         self.runTest(model)
Example #2
0
 def test_scenario_ppo2(self):
     seed = 42
     fdir = os.path.dirname(os.path.abspath(__file__))
     #   path = os.sep.join([fdir, 'models',  'AmidarToyboxNoFrameskip-v4.ppo2.5e7.3771075072.2019-05-18.model'])
     path = 'models/AmidarToyboxNoFrameskip-v4.regress.model'
     model = oai.getModel(self.env, 'ppo2', seed, path)
     # Set low to be a test of a test!
     self.runTest(model)
Example #3
0
 def test_ezchannel_ppo2(self):
     seed = 8675309
     path = 'models/BreakoutToyboxNoFrameskip-v4.regress.model'
     with brk.BreakoutIntervention(self.getToybox()) as intervention:
         bricks = intervention.game.bricks
     with tf.Session(graph=tf.Graph()):
         model = oai.getModel(self.env, 'ppo2', seed, path)
         bricks = random.choice(bricks, 2)
         self.runTest(model, collection=bricks)
Example #4
0
 def test_no_enemies_all_models(self):
     seed = 42
     fdir = os.path.dirname(os.path.abspath(__file__))
     models = [
         f for f in os.listdir(fdir + os.sep + 'models')
         if f.startswith('Amidar')
     ]
     print('num models:', len(models))
     for trained in models:
         print(trained)
         path = os.sep.join([fdir, 'models', trained])
         family = trained.split('.')[1]
         with tf.Session(graph=tf.Graph()):
             model = oai.getModel(self.env, family, seed, path)
             self.runTest(model)
Example #5
0
 def test_polar_starts_regress(self):
     with tf.Session(graph=tf.Graph()):
         model = oai.getModel(self.env, 'ppo2', seed, path)
         degs = random.choice(range(0, 360, 5), 2)
         self.runTest(model, collection=degs)
Example #6
0
 def test_shieldxs_ppo2(self):
   model = oai.getModel(self.env, 'ppo2', seed, path)
   shield_configs = [(1,0,0), (0,1,0), (0,0,1), (0,0,0), (1,1,1)]
   self.xs_observed = Counter()
   self.runTest(model, collection=shield_configs)
Example #7
0
 def test_no_shields_ppo2(self):
   model = oai.getModel(self.env, 'ppo2', seed, path)
   ps = random.choice([n/10 for n in range(11)], 2)
   self.runTest(model, collection=ps)
Example #8
0
 def test_no_shields_ppo2(self):
   model = oai.getModel(self.env, 'ppo2', seed, path)
   self.runTest(model)