Module TeachMyAgent.students.openai_baselines.common.vec_env.vec_remove_dict_obs

Expand source code
from .vec_env import VecEnvObservationWrapper

class VecExtractDictObs(VecEnvObservationWrapper):
    def __init__(self, venv, key):
        self.key = key
        super().__init__(venv=venv,
            observation_space=venv.observation_space.spaces[self.key])

    def process(self, obs):
        return obs[self.key]

Classes

class VecExtractDictObs (venv, key)

An environment wrapper that applies to an entire batch of environments at once.

Expand source code
class VecExtractDictObs(VecEnvObservationWrapper):
    def __init__(self, venv, key):
        self.key = key
        super().__init__(venv=venv,
            observation_space=venv.observation_space.spaces[self.key])

    def process(self, obs):
        return obs[self.key]

Ancestors

Methods

def process(self, obs)
Expand source code
def process(self, obs):
    return obs[self.key]

Inherited members