digideep.environment.common package

Submodules

digideep.environment.common.atari_wrappers module

The MIT License

Copyright (c) 2017 OpenAI (http://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class digideep.environment.common.atari_wrappers.ClipRewardEnv(env)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

reward(reward)[source]

Bin reward to {+1, 0, -1} by its sign.

class digideep.environment.common.atari_wrappers.EpisodicLifeEnv(env)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

reset(**kwargs)[source]

Reset only when lives are exhausted. This way all states are still reachable even though lives are episodic, and the learner need not know about any of this behind-the-scenes.

step(action)[source]
class digideep.environment.common.atari_wrappers.FireResetEnv(env)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

reset(**kwargs)[source]
step(ac)[source]
class digideep.environment.common.atari_wrappers.FrameStack(env, k)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

reset()[source]
step(action)[source]
class digideep.environment.common.atari_wrappers.LazyFrames(frames)[source]

Bases: object

class digideep.environment.common.atari_wrappers.MaxAndSkipEnv(env, skip=4)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

reset(**kwargs)[source]
step(action)[source]

Repeat action, sum reward, and max over last observations.

class digideep.environment.common.atari_wrappers.NoopResetEnv(env, noop_max=30)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

reset(**kwargs)[source]

Do no-op action for a number of steps in [1, noop_max].

step(ac)[source]
class digideep.environment.common.atari_wrappers.ScaledFloatFrame(env)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

observation(observation)[source]
class digideep.environment.common.atari_wrappers.WarpFrame(env, width=84, height=84, grayscale=True)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

observation(frame)[source]
digideep.environment.common.atari_wrappers.make_atari(env_id, timelimit=True)[source]
digideep.environment.common.atari_wrappers.wrap_deepmind(env, episode_life=True, clip_rewards=True, frame_stack=False, scale=False)[source]

Configure environment for DeepMind-style Atari.

digideep.environment.common.monitor module

The MIT License

Copyright (c) 2017 OpenAI (http://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class digideep.environment.common.monitor.Monitor(env, filename, allow_early_resets=False, reset_keywords=(), info_keywords=())[source]

Bases: sphinx.ext.autodoc.importer._MockObject

EXT = 'monitor.csv'
close()[source]
f = None
get_episode_lengths()[source]
get_episode_rewards()[source]
get_episode_times()[source]
get_total_steps()[source]
reset(**kwargs)[source]
reset_state()[source]
step(action)[source]
update(ob, rew, done, info)[source]
digideep.environment.common.monitor.get_monitor_files(dir)[source]
digideep.environment.common.monitor.load_results(dir)[source]

digideep.environment.common.running_mean_std module

The MIT License

Copyright (c) 2017 OpenAI (http://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

class digideep.environment.common.running_mean_std.RunningMeanStd(epsilon=0.0001, shape=())[source]

Bases: object

load_state_dict(state_dict)[source]
state_dict()[source]
update(x)[source]
update_from_moments(batch_mean, batch_var, batch_count)[source]
digideep.environment.common.running_mean_std.test_runningmeanstd()[source]
digideep.environment.common.running_mean_std.update_mean_var_count_from_moments(mean, var, count, batch_mean, batch_var, batch_count)[source]

digideep.environment.common.tile_images module

The MIT License

Copyright (c) 2017 OpenAI (http://openai.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

digideep.environment.common.tile_images.tile_images(img_nhwc)[source]

Tile N images into one big PxQ image (P,Q) are chosen to be as close as possible, and if N is square, then P=Q.

Parameters:img_nhwc – list or array of images, ndim=4 once turned into array n = batch index, h = height, w = width, c = channel
Returns:ndarray with ndim=3
Return type:bigim_HWc

Module contents