graph2mat.bindings.torch.modules.graph2mat

Torch wrappers for Graph2Mat.

Classes

TorchGraph2Mat(*args, numpy[, ...])

Wrapper for Graph2Mat to make it use torch instead of numpy.

class graph2mat.bindings.torch.modules.graph2mat.TorchGraph2Mat(*args, numpy: ~types.ModuleType = <module 'torch' from '/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/torch/__init__.py, self_interactions_list=torch.nn.modules.container.ModuleList, interactions_dict=torch.nn.modules.container.ModuleDict, **kwargs)[source]

Bases: Graph2Mat, Module

Wrapper for Graph2Mat to make it use torch instead of numpy.

It also makes Graph2Mat a torch.nn.Module, and it makes it store the list of node block functions as a torch.nn.ModuleList and the dictionary of edge block functions as a torch.nn.ModuleDict.

Parameters:

**kwargs – Additional arguments passed to the Graph2Mat class.

See also

Graph2Mat

The class that TorchGraph2Mat extends. Its documentation contains a more detailed explanation of the inner workings of the class.

__init__(*args, numpy: ~types.ModuleType = <module 'torch' from '/opt/hostedtoolcache/Python/3.11.12/x64/lib/python3.11/site-packages/torch/__init__.py, self_interactions_list=torch.nn.modules.container.ModuleList, interactions_dict=torch.nn.modules.container.ModuleDict, **kwargs)[source]
basis_filters: ArrayType | None

If the basis_grouping is “max”, this is a mask that is used to select the values for the original basis from the new grouped basis. This has shape (n_point_types, dim_new_basis).

basis_table: BasisTableWithEdges

The table holding all information about the basis. This is an internal table created by the module from unique_basis, but it should probably be equal to the basis table that you use to process your data.

edge_filters: ArrayType | None

If the basis_grouping is “max”, mask to select values from edge operations This has shape (n_edge_types, dim_new_basis, dim_new_basis).

edge_types_to_graph2mat: ArrayType

The mapping of edge types from the original basis to the graph2mat basis.

graph2mat_table: List[PointBasis]

The basis table used internally by graph2mat

interactions: Dict[Tuple[int, int], MatrixBlock]

Dictionary of interaction functions (which compute edge blocks).

node_filters: ArrayType | None

If the basis_grouping is “max”, mask to select values from node operations This has shape (n_point_types, dim_new_basis, dim_new_basis).

self_interactions: List[MatrixBlock]

List of self interaction functions (which compute node blocks).

training: bool
types_to_graph2mat: ArrayType

The mapping of types from the original basis to the graph2mat basis.