morphoclass.transforms.edge_features.extract_distance_weights module

Implementation of the distance weights edge feature extractor.

class morphoclass.transforms.edge_features.extract_distance_weights.ExtractDistanceWeights(scale=1.0)

Bases: morphoclass.transforms.edge_features.extract_edge_features.ExtractEdgeFeatures

The distance weights edge feature extractor.

The feature is computed as exp(-len(edge)^2 / scale^2).

Parameters

scale (float) – The scale factor for the formula above.

extract_edge_features(data)

Extract the distance weights edge features from given data sample.

The feature is computed as exp(-len(edge)^2 / scale^2).

Parameters

data (torch_geometric.data.Data) – A data sample.

Returns

edge_attr – The extracted distance weights edge features.

Return type

torch.tensor