topobench.nn.encoders.flat_encoder module#

Flat graph encoder.

class AbstractFeatureEncoder#

Bases: Module

Abstract class to define a custom feature encoder.

__init__()#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

abstract forward(data)#

Forward pass of the feature encoder model.

Parameters:
datatorch_geometric.data.Data

Input data object which should contain x features.

class FlatEncoder(in_channels, out_channels, **kwargs)#

Bases: AbstractFeatureEncoder

Abstract class to define a custom feature encoder.

Parameters:
in_channelsint

Number of input channels.

out_channelsint

Number of output channels.

**kwargs

Additional keyword arguments.

__init__(in_channels, out_channels, **kwargs)#

Initialize internal Module state, shared by both nn.Module and ScriptModule.

forward(data)#

Forward pass of the flat encoder.

Parameters:
datatorch_geometric.data.Data

Input data object which should contain x features.

Returns:
torch_geometric.data.Data

Output data object with flattened features.