-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a module of wrappers for CompilerEnv environments. #272
Add a module of wrappers for CompilerEnv environments. #272
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super useful, exactly what I have been mimicing :D This gives a modular way to experiment with different action/env configurations.
Can we add the time limit wrapper as well? Fixed horizon is a very standard setup.
dd74530
to
21d75a1
Compare
Codecov Report
@@ Coverage Diff @@
## development #272 +/- ##
===============================================
- Coverage 83.52% 81.99% -1.54%
===============================================
Files 78 86 +8
Lines 4426 4677 +251
===============================================
+ Hits 3697 3835 +138
- Misses 729 842 +113
Continue to review full report at Codecov.
|
This adds a series of helper wrappers under a new `compiler_gym.warppers` module that makes it easier to modify the behavior of CompilerEnv environments without having to change the underlying implementation. New classes are: * `CompilerEnvWrapper` an extension to `gym.Wrapper` to support the custom compiler_gym API calls. * `ActionWrapper` compatibility with `gym.ActionWrapper`. * `CommandlineWithTerminalAction` adds an "end of episode" action to a commandline space. * `ConstrainedCommandline` allows a subset of commandline flags to be selected for use. * `CycleOverBenchmarks` loop over a list of benchamrks on `reset()`. * `IterateOverBenchmarks` same as above but the iterator is exhaustible. * `RandomOrderBenchmarks` same as above but the order is random and non-terminating.
Good idea, done. |
This adds a series of helper wrappers under a new
compiler_gym.warppers
module that makes it easier to modify thebehavior of CompilerEnv environments without having to change the
underlying implementation.
New classes are:
CompilerEnvWrapper
an extension togym.Wrapper
to support thecustom compiler_gym API calls.
ActionWrapper
compatibility withgym.ActionWrapper
.CommandlineWithTerminalAction
adds an "end of episode" action to acommandline space.
ConstrainedCommandline
allows a subset of commandline flags to beselected for use.
CycleOverBenchmarks
loop over a list of benchamrks onreset()
.IterateOverBenchmarks
same as above but the iterator isexhaustible.
RandomOrderBenchmarks
same as above but the order is random andnon-terminating.