Liftings#

Abstract class for topological liftings.

class topobenchmarkx.transforms.liftings.base.AbstractLifting(feature_lifting=None, **kwargs)[source]#

Abstract class for topological liftings.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

forward(data: Data) Data[source]#

Apply the full lifting (topology + features) to the input data.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
torch_geometric.data.Data

The lifted data.

abstract lift_topology(data: Data) dict[source]#

Lift the topology of a graph to higher-order topological domains.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

This module implements the liftings for the topological transforms.

class topobenchmarkx.transforms.liftings.AbstractLifting(feature_lifting=None, **kwargs)[source]#

Abstract class for topological liftings.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

forward(data: Data) Data[source]#

Apply the full lifting (topology + features) to the input data.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
torch_geometric.data.Data

The lifted data.

abstract lift_topology(data: Data) dict[source]#

Lift the topology of a graph to higher-order topological domains.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

class topobenchmarkx.transforms.liftings.CellComplexLifting(feature_lifting='ProjectionSum', **kwargs)[source]#

Abstract class for lifting cell complexes to other domains.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

class topobenchmarkx.transforms.liftings.CombinatorialLifting(feature_lifting='ProjectionSum', **kwargs)[source]#

Abstract class for lifting combinatorial complexes to other domains.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

class topobenchmarkx.transforms.liftings.GraphLifting(feature_lifting='ProjectionSum', preserve_edge_attr=False, **kwargs)[source]#

Abstract class for lifting graph topologies to other domains.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

preserve_edge_attrbool, optional

Whether to preserve edge attributes. Default is False.

**kwargsoptional

Additional arguments for the class.

class topobenchmarkx.transforms.liftings.HypergraphLifting(feature_lifting='ProjectionSum', **kwargs)[source]#

Abstract class for lifting hypergraphs to other domains.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

class topobenchmarkx.transforms.liftings.PointCloudLifting(feature_lifting='ProjectionSum', **kwargs)[source]#

Abstract class for lifting point clouds to other topological domains.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

class topobenchmarkx.transforms.liftings.SimplicialLifting(feature_lifting='ProjectionSum', **kwargs)[source]#

Abstract class for lifting simplicial complexes to other domains.

Parameters:
feature_liftingstr, optional

The feature lifting method to be used. Default is ‘ProjectionSum’.

**kwargsoptional

Additional arguments for the class.

Abstract class for lifting graphs to cell complexes.

class topobenchmarkx.transforms.liftings.graph2cell.base.Graph2CellLifting(complex_dim=2, **kwargs)[source]#

Abstract class for lifting graphs to cell complexes.

Parameters:
complex_dimint, optional

The dimension of the cell complex to be generated. Default is 2.

**kwargsoptional

Additional arguments for the class.

This module implements the cycle lifting for graphs to cell complexes.

class topobenchmarkx.transforms.liftings.graph2cell.cycle.CellCycleLifting(max_cell_length=None, **kwargs)[source]#

Lift graphs to cell complexes.

The algorithm creates 2-cells by identifying the cycles and considering them as 2-cells.

Parameters:
max_cell_lengthint, optional

The maximum length of the cycles to be lifted. Default is None.

**kwargsoptional

Additional arguments for the class.

lift_topology(data: Data) dict[source]#

Find the cycles of a graph and lifts them to 2-cells.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

Abstract class for lifting graphs to hypergraphs.

class topobenchmarkx.transforms.liftings.graph2hypergraph.base.Graph2HypergraphLifting(**kwargs)[source]#

Abstract class for lifting graphs to hypergraphs.

Parameters:
**kwargsoptional

Additional arguments for the class.

This module implements the k-hop lifting of graphs to hypergraphs.

class topobenchmarkx.transforms.liftings.graph2hypergraph.khop.HypergraphKHopLifting(k_value=1, **kwargs)[source]#

Lift graph to hypergraphs by considering k-hop neighborhoods.

The class transforms graphs to hypergraph domain by considering k-hop neighborhoods of a node. This lifting extracts a number of hyperedges equal to the number of nodes in the graph.

Parameters:
k_valueint, optional

The number of hops to consider. Default is 1.

**kwargsoptional

Additional arguments for the class.

lift_topology(data: Data) dict[source]#

Lift a graphs to hypergraphs by considering k-hop neighborhoods.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

This module implements the HypergraphKNNLifting class.

class topobenchmarkx.transforms.liftings.graph2hypergraph.knn.HypergraphKNNLifting(k_value=1, loop=True, **kwargs)[source]#

Lift graphs to hypergraph domain by considering k-nearest neighbors.

Parameters:
k_valueint, optional

The number of nearest neighbors to consider. Default is 1.

loopbool, optional

If True the hyperedges will contain the node they were created from.

**kwargsoptional

Additional arguments for the class.

lift_topology(data: Data) dict[source]#

Lift a graph to hypergraph by considering k-nearest neighbors.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

Abstract class for lifting graphs to simplicial complexes.

class topobenchmarkx.transforms.liftings.graph2simplicial.base.Graph2SimplicialLifting(complex_dim=2, **kwargs)[source]#

Abstract class for lifting graphs to simplicial complexes.

Parameters:
complex_dimint, optional

The maximum dimension of the simplicial complex to be generated. Default is 2.

**kwargsoptional

Additional arguments for the class.

This module implements the CliqueLifting class, which lifts graphs to simplicial complexes.

class topobenchmarkx.transforms.liftings.graph2simplicial.clique.SimplicialCliqueLifting(**kwargs)[source]#

Lift graphs to simplicial complex domain.

The algorithm creates simplices by identifying the cliques and considering them as simplices of the same dimension.

Parameters:
**kwargsoptional

Additional arguments for the class.

lift_topology(data: Data) dict[source]#

Lift the topology of a graph to a simplicial complex.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.

This module implements the k-hop lifting of graphs to simplicial complexes.

class topobenchmarkx.transforms.liftings.graph2simplicial.khop.SimplicialKHopLifting(max_k_simplices=5000, **kwargs)[source]#

Lift graphs to simplicial complex domain.

The function lifts a graph to a simplicial complex by considering k-hop neighborhoods. For each node its neighborhood is selected and then all the possible simplices, when considering the neighborhood as a clique, are added to the simplicial complex. For this reason this lifting does not conserve the initial graph topology.

Parameters:
max_k_simplicesint, optional

The maximum number of k-simplices to consider. Default is 5000.

**kwargsoptional

Additional arguments for the class.

lift_topology(data: Data) dict[source]#

Lift the topology to simplicial complex domain.

Parameters:
datatorch_geometric.data.Data

The input data to be lifted.

Returns:
dict

The lifted topology.