cntk.contrib.deeprl.agent.shared.preprocessing module

Base class for defining preprocessing, as well as two concrete examples.

class AtariPreprocessing(input_shape, history_len=4)[source]

Bases: cntk.contrib.deeprl.agent.shared.preprocessing.Preprocessing

Preprocess screen images from Atari 2600 games.

The image is represented by an array of shape (210, 160, 3). See https://storage.googleapis.com/deepmind-media/dqn/DQNNaturePaper.pdf for more details.

output_shape()[source]

Return shape of preprocessed Atari images.

preprocess(image)[source]

Return preprocessed screen images from Atari 2600 games.

reset()[source]

Reset preprocessing pipeline for new episode.

class Preprocessing(input_shape)[source]

Bases: object

Base class for defining preprocessing.

All subclass constructors will take input_shape as the first argument.

output_shape()[source]

Return shape of preprocessed observation.

preprocess(observation)[source]

Return preprocessed observation.

reset()[source]

Reset preprocessing pipeline for new episode.

class SlidingWindow(input_shape, history_len=4, dtype=<class 'numpy.float32'>)[source]

Bases: cntk.contrib.deeprl.agent.shared.preprocessing.Preprocessing

Stack windowed inputs (x(t-m+1), ... x(t)).

output_shape()[source]

Return shape of preprocessed input.

preprocess(x)[source]

Return preprocessed input x.

reset()[source]

Reset preprocessing pipeline for new episode.