Graph Descriptors
Generic Graph Descriptors
polygraph.utils.descriptors.DegreeHistogram
Bases: GraphDescriptor[Graph]
Computes normalized degree distributions of graphs.
For each graph, computes a histogram of node degrees and normalizes it to sum to 1. Pads all histograms to a fixed maximum degree.
| Parameters: |
|
|---|
polygraph.utils.descriptors.SparseDegreeHistogram
Bases: GraphDescriptor[Graph]
Memory-efficient version of degree distribution computation.
Similar to DegreeHistogram but returns a sparse matrix, making it suitable for graphs with high maximum degree where most degree bins are empty.
polygraph.utils.descriptors.ClusteringHistogram
Bases: GraphDescriptor[Graph]
Computes histograms of local clustering coefficients.
For each graph, computes the distribution of local clustering coefficients across nodes. The clustering coefficient measures the fraction of possible triangles through each node that exist.
| Parameters: |
|
|---|
polygraph.utils.descriptors.OrbitCounts
Bases: GraphDescriptor[Graph]
Computes graph orbit statistics .
Warning
Self-loops are automatically removed from input graphs.
polygraph.utils.descriptors.EigenvalueHistogram
Bases: GraphDescriptor[Graph]
Computes eigenvalue histogram of normalized Laplacian.
For each graph, computes the eigenvalue spectrum of its normalized Laplacian matrix and returns a histogram of the eigenvalues.
| Parameters: |
|
|---|
polygraph.utils.descriptors.RandomGIN
Bases: GraphDescriptor[Graph]
Random Graph Isomorphism Network for graph embeddings.
Initializes a randomly weighted Graph Isomorphism Network (GIN) and uses it to compute graph embeddings. The network parameters are fixed after random initialization. Node features default to node degrees if not specified.
| Parameters: |
|
|---|
polygraph.utils.descriptors.WeisfeilerLehmanDescriptor
Bases: GraphDescriptor[Graph]
Weisfeiler-Lehman subtree features for graphs.
Computes graph features by iteratively hashing node neighborhoods using the WL algorithm. Returns sparse feature vectors where each dimension corresponds to a subtree pattern.
Warning
Hash collisions may occur, as at most \(2^{31}\) unique hashes are used.
| Parameters: |
|
|---|
polygraph.utils.descriptors.NormalizedDescriptor
Bases: GraphDescriptor[GraphType], Generic[GraphType]
Standardizes graph descriptors using reference graph statistics.
Wraps a graph descriptor to standardize its output features (zero mean, unit variance) based on statistics computed from a set of reference graphs. This is useful when different features have very different scales.
The wrapped graph descriptor must return a dense numpy array.
| Parameters: |
|
|---|
Molecule Descriptors
polygraph.utils.descriptors.molecule_descriptors.TopoChemicalDescriptor
polygraph.utils.descriptors.molecule_descriptors.FingerprintDescriptor
Bases: GraphDescriptor[Mol]
Computes molecular fingerprints.
| Parameters: |
|
|---|
polygraph.utils.descriptors.molecule_descriptors.LipinskiDescriptor
polygraph.utils.descriptors.molecule_descriptors.ChemNetDescriptor
Bases: GraphDescriptor[Mol]
Random projection of ChemNet embeddings.
| Parameters: |
|
|---|
polygraph.utils.descriptors.molecule_descriptors.MolCLRDescriptor
Bases: GraphDescriptor[Mol]
Random projection of MolCLR embeddings.
| Parameters: |
|
|---|