Ejemplo n.º 1
0
 def _ray_function():
     init_ray()
     env = ray_function()
     params = {
         "actions": {
             "dtype": numpy.int64
         },
         "critic": {
             "dtype": numpy.float32
         }
     }
     states = StatesModel(state_dict=params, batch_size=N_WALKERS)
     return env, states
 def swarm_with_score(self, request):
     init_ray()
     swarm = swarm_dict.get(request.param, create_cartpole_swarm)()
     score = test_scores[request.param]
     request.addfinalizer(lambda: kill_swarm(swarm))
     return swarm, score
Ejemplo n.º 3
0
def export_swarm(request):
    init_ray()
    swarm = swarm_dict.get(request.param)()
    request.addfinalizer(lambda: kill_swarm(swarm))
    return swarm
Ejemplo n.º 4
0
def export_swarm(request):
    init_ray()
    swarm = swarm_dict.get(request.param)()
    yield swarm
    kill_swarm(swarm)