gfn.envs.preprocessors

Submodules

Package Contents

Classes

EnumPreprocessor

Preprocessor applicable to environments with discrete states.

IdentityPreprocessor

Simple preprocessor applicable to environments with uni-dimensional states.

KHotPreprocessor

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

OneHotPreprocessor

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

Preprocessor

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

class gfn.envs.preprocessors.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.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

class gfn.envs.preprocessors.KHotPreprocessor(height, ndim, get_states_indices)

Bases: gfn.envs.preprocessors.base.Preprocessor

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
name = k_hot
preprocess(states)
class gfn.envs.preprocessors.OneHotPreprocessor(n_states, get_states_indices)

Bases: gfn.envs.preprocessors.base.Preprocessor

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
name = one_hot
preprocess(states)
class gfn.envs.preprocessors.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