Conversation
|
okay, next one is this. |
Codecov Report
@@ Coverage Diff @@
## master #11 +/- ##
==========================================
+ Coverage 51.28% 60.41% +9.13%
==========================================
Files 1 1
Lines 39 48 +9
==========================================
+ Hits 20 29 +9
Misses 19 19
Continue to review full report at Codecov.
|
| pacmannf = GymEnv("MsPacmanNoFrameskip-v4") | ||
| cartpole = GymEnv("CartPole-v0") | ||
| bj = GymEnv("Blackjack-v0") | ||
| bj = GymEnv("Blackjack-v0", stateT=PyAny) |
There was a problem hiding this comment.
I tried stateT = PyVector and it works.
Is there any significant difference if I use PyVector?
There was a problem hiding this comment.
For BlackJack, I don't know - I'll check.
As a default for envs? PyArray will be much quicker I believe, because getindex(::PyArray, ...) is just a pointer lookup. It's also much more appropriate for, e.g., atari games, which return images (frames from the screen).
There was a problem hiding this comment.
PyVector is faster than PyAny for just stepping the environment:
Trial 1 (PyVector one is the second one):
env.pyenv: PyObject <gym.envs.toy_text.blackjack.BlackjackEnv object at 0x1266ec470> num_eps: 30000 t: 0.9989846660000005 steps: 41180
microsecs/step (lower is better): 24.25897683341429
------------------------------
env.pyenv: PyObject <gym.envs.toy_text.blackjack.BlackjackEnv object at 0x1266f95c0> num_eps: 30000 t: 0.7416911469999994 steps: 41335
microsecs/step (lower is better): 17.943417128341586
Trial 2:
env.pyenv: PyObject <gym.envs.toy_text.blackjack.BlackjackEnv object at 0x129ae4a20> num_eps: 30000 t: 0.8304164830000038 steps: 41227
microsecs/step (lower is better): 20.142539670604307
------------------------------
env.pyenv: PyObject <gym.envs.toy_text.blackjack.BlackjackEnv object at 0x129ae4b70> num_eps: 30000 t: 0.737025869000004 steps: 41307
microsecs/step (lower is better): 17.842638511632508
dunno about doing stuff with the PyVector, as compared to the Tuple{Int64,Int64,Bool}, but don't really care either ![]()
There was a problem hiding this comment.
btw blackjack is faster than python in these benchmarks because the env.step is so quick that julia's advantage in loop speed becomes a factor
There was a problem hiding this comment.
At least I figure that's what's happening.
BlackJack can't be converted to PyArray, all other Gym envs can :/
|
🎉 🙌 |
Adds a state type param, improves type inference, and speed.
Requires JuliaML/Reinforce.jl/pull/23
This builds on #10