Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

Please add Bsuite #40

Open
bionicles opened this issue May 29, 2020 · 0 comments
Open

Please add Bsuite #40

bionicles opened this issue May 29, 2020 · 0 comments

Comments

@bionicles
Copy link

bionicles commented May 29, 2020

How could we add the DeepMind BSuite envs?

They have a wrapper for OpenAI Gym: https://github.com/deepmind/bsuite#using-bsuite-in-openai-gym-format

Got ProcGen to work if anyone wants it:

using OpenAIGym

function run_env(env_name, n_episodes)
    println("Run $n_episodes of $env_name") 
    env = GymEnv(env_name)
    for i ∈ 1:n_episodes
      T = 0
      R = run_episode(env, RandomPolicy()) do (s, a, r, s′)
        render(env)
        T += 1
      end
      @info("Episode $i finished after $T steps. Total reward: $R")
    end
    close(env)
end

env_names = ["procgen:procgen-$stub-v0" for stub in ["bigfish","bossfight","caveflyer","chaser","climber","coinrun","dodgeball","fruitbot",
    "heist","jumper","leaper","maze","miner","ninja","plunder","starpilot"]]
get_env_name() = env_names[rand(1:length(env_names))]

function run_envs(n_envs, n_episodes)
    println("Run $n_envs procgen envs")
    for i ∈ 1:n_envs
        T = 0
        env_name = get_env_name()
        run_env(env_name, n_episodes)
    end
end
n_envs, n_episodes = 10,5
run_envs(n_envs, n_episodes)

I also have custom envs for molecular dynamics, NLP, causality, [self]supervised learning, etc if anyone wants them

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant