02716e101ec2a8eb7284f95b17a7e589ffbc075d,ch06/01_dqn_pong.py,ImageWrapper,_observation,#ImageWrapper#Any#,34
Before Change
def _observation(self, obs):
obs = imresize(obs, (110, 84))
obs = obs.mean(axis=-1, keepdims=True)
obs = obs[self.X_OFS:self.X_OFS+84, :, :]
obs = np.moveaxis(obs, 2, 0)
return obs.astype(np.float32) / 255.0
After Change
self.observation_space = gym.spaces.Box(0, 255, self._observation(probe).shape)
def _observation(self, obs):
img = Image.fromarray(obs)
img = img.convert("YCbCr")
img = img.resize((self.TARGET_SIZE, self.TARGET_SIZE))
data = np.asarray(img.getdata(0), np.uint8).reshape(img.size)
return np.expand_dims(data, 0)
class BufferWrapper(gym.ObservationWrapper):
def __init__(self, env, n_steps, dtype=np.uint8):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 02716e101ec2a8eb7284f95b17a7e589ffbc075d
Time: 2017-10-18
Author: max.lapan@gmail.com
File Name: ch06/01_dqn_pong.py
Class Name: ImageWrapper
Method Name: _observation
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 02716e101ec2a8eb7284f95b17a7e589ffbc075d
Time: 2017-10-18
Author: max.lapan@gmail.com
File Name: ch06/01_dqn_pong.py
Class Name: ImageWrapper
Method Name: _observation
Project Name: scikit-learn-contrib/DESlib
Commit Name: f0c15f219b0761b14329ddd416cda82fa4bae841
Time: 2018-03-28
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/mcb.py
Class Name: MCB
Method Name: estimate_competence
Project Name: scikit-learn-contrib/DESlib
Commit Name: f7a04171e58eb43dfe5b18d06c76481cdf1c5da9
Time: 2018-03-29
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/lca.py
Class Name: LCA
Method Name: estimate_competence