pytorchrl.agent.env.openai_baselines_dependencies package

Subpackages

Submodules

pytorchrl.agent.env.openai_baselines_dependencies.Monitor module

exception pytorchrl.agent.env.openai_baselines_dependencies.Monitor.LoadMonitorResultsError[source]

Bases: Exception

class pytorchrl.agent.env.openai_baselines_dependencies.Monitor.Monitor(env, filename, allow_early_resets=False, reset_keywords=(), info_keywords=())[source]

Bases: gym.core.Wrapper

EXT = 'monitor.csv'
close()[source]

Override close in your subclass to perform any necessary cleanup.

Environments will automatically close() themselves when garbage collected or when the program exits.

f = None
get_episode_lengths()[source]
get_episode_rewards()[source]
get_episode_times()[source]
get_total_steps()[source]
reset(**kwargs)[source]

Resets the environment to an initial state and returns an initial observation.

Note that this function should not reset the environment’s random number generator(s); random variables in the environment’s state should be sampled independently between multiple calls to reset(). In other words, each call of reset() should yield an environment suitable for a new episode, independent of previous episodes.

Returns

the initial observation.

Return type

observation (object)

reset_state()[source]
step(action)[source]

Run one timestep of the environment’s dynamics. When end of episode is reached, you are responsible for calling reset() to reset this environment’s state.

Accepts an action and returns a tuple (observation, reward, done, info).

Parameters

action (object) – an action provided by the agent

Returns

agent’s observation of the current environment reward (float) : amount of reward returned after previous action done (bool): whether the episode has ended, in which case further step() calls will return undefined results info (dict): contains auxiliary diagnostic information (helpful for debugging, and sometimes learning)

Return type

observation (object)

update(ob, rew, done, info)[source]
class pytorchrl.agent.env.openai_baselines_dependencies.Monitor.ResultsWriter(filename, header='', extra_keys=())[source]

Bases: object

write_row(epinfo)[source]
pytorchrl.agent.env.openai_baselines_dependencies.Monitor.get_monitor_files(dir)[source]
pytorchrl.agent.env.openai_baselines_dependencies.Monitor.load_results(dir)[source]

pytorchrl.agent.env.openai_baselines_dependencies.load_baselines_results module

pytorchrl.agent.env.openai_baselines_dependencies.load_baselines_results.load_baselines_results(dir)[source]

Module contents