gfn.envs.preprocessors.base

Module Contents

Classes

EnumPreprocessor

Preprocessor applicable to environments with discrete states.

IdentityPreprocessor

Simple preprocessor applicable to environments with uni-dimensional states.

Preprocessor

Base class for Preprocessors. The goal is to transform tensors representing raw states

Attributes

OutputTensor

class gfn.envs.preprocessors.base.EnumPreprocessor(get_states_indices)

Bases: Preprocessor

Preprocessor applicable to environments with discrete states.

Parameters

get_states_indices (Callable[[gfn.containers.States], OutputTensor]) –

name = EnumPreprocessor
preprocess(states)
class gfn.envs.preprocessors.base.IdentityPreprocessor(output_shape)

Bases: Preprocessor

Simple preprocessor applicable to environments with uni-dimensional states. This is the default preprocessor used.

Parameters

output_shape (Tuple[int]) –

name = IdentityPreprocessor
preprocess(states)
Parameters

states (gfn.containers.States) –

Return type

OutputTensor

gfn.envs.preprocessors.base.OutputTensor
class gfn.envs.preprocessors.base.Preprocessor(output_shape)

Bases: abc.ABC

Base class for Preprocessors. The goal is to transform tensors representing raw states to tensors that can be used as input to neural networks.

Parameters

output_shape (Tuple[int]) –

name :str = Preprocessor
__call__(states)
Parameters

states (gfn.containers.States) –

Return type

OutputTensor

__repr__()

Return repr(self).

abstract preprocess(states)
Parameters

states (gfn.containers.States) –

Return type

OutputTensor