02716e101ec2a8eb7284f95b17a7e589ffbc075d,ch06/01_dqn_pong.py,ImageWrapper,_observation,#ImageWrapper#Any#,34

Before Change


        self.observation_space = gym.spaces.Box(0, 1, self._observation(env.observation_space.low).shape)

    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


class BufferWrapper(gym.ObservationWrapper):

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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

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: matplotlib/matplotlib
Commit Name: 86fbce741040ff4cb1e0566049af3f99aab834f4
Time: 2019-07-30
Author: anntzer.lee@gmail.com
File Name: examples/misc/agg_buffer.py
Class Name:
Method Name:


Project Name: utkuozbulak/pytorch-cnn-visualizations
Commit Name: 818b177b0d10394c1fd1c75465ff55aabadb221b
Time: 2018-12-30
Author: utku.ozbulak@gmail.com
File Name: src/gradcam.py
Class Name: GradCam
Method Name: generate_cam


Project Name: matplotlib/matplotlib
Commit Name: 86fbce741040ff4cb1e0566049af3f99aab834f4
Time: 2019-07-30
Author: anntzer.lee@gmail.com
File Name: examples/user_interfaces/canvasagg.py
Class Name:
Method Name: