gfn.preprocessors

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

class gfn.preprocessors.EnumPreprocessor(get_states_indices)

Bases: Preprocessor

Preprocessor applicable to environments with discrete states.

Parameters

get_states_indices (Callable[[gfn.states.States], torchtyping.TensorType[batch_shape, input_dim]]) –

preprocess(states)
class gfn.preprocessors.IdentityPreprocessor(output_dim)

Bases: Preprocessor

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

Parameters

output_dim (int) –

preprocess(states)
Parameters

states (gfn.states.States) –

Return type

torchtyping.TensorType[batch_shape, input_dim]

class gfn.preprocessors.Preprocessor(output_dim)

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_dim (int) –

__call__(states)
Parameters

states (gfn.states.States) –

Return type

torchtyping.TensorType[batch_shape, input_dim]

__repr__()

Return repr(self).

abstract preprocess(states)
Parameters

states (gfn.states.States) –

Return type

torchtyping.TensorType[batch_shape, input_dim]