pydgc.pipelines
pydgc.pipelines.agcdrr_pipeline
- class AGCDRRPipeline(args)[source]
Bases:
BasePipelineAGCDRR pipeline.
- Parameters:
args (Namespace) – Arguments.
pydgc.pipelines.base_pipeline
- class BasePipeline(args)[source]
Bases:
ABCStandardized pipeline for deep graph clustering.
- Parameters:
args (Namespace) – Arguments for setting values frequently changed.
- load_config()[source]
load config from yaml
- Parameters:
self.cfg_file_path (str) – Path to the config file.
self.dataset_name (str) – Name of the dataset.
- load_dataset()[source]
Load dataset.
- Parameters:
self.cfg (CN) – Config object.
self.dataset_name (str) – Name of the dataset.
- abstract build_model()[source]
Build model.
- Parameters:
self.cfg (CN) – Config object.
- Returns:
Model object.
- Return type:
pydgc.pipelines.ccgc_pipeline
- preprocess_graph(adj, layer, norm='sym', renorm=True)[source]
Preprocess graph.
- Parameters:
adj (sp.csr_matrix) – Adjacency matrix.
layer (int) – Number of layers.
norm (str) – Normalization method.
renorm (bool) – Whether to renormalize the adjacency matrix.
- Returns:
List of preprocessed adjacency matrices.
- Return type:
list
pydgc.pipelines.daegc_pipeline
pydgc.pipelines.dcrn_pipeline
- normalize_adj(adj, self_loop=True, symmetry=False)[source]
Normalize the adj matrix.
- Parameters:
adj (np.ndarray) – Input adj matrix.
self_loop (bool) – If add the self loop or not.
symmetry (bool) – Symmetry normalize or not.
- Returns:
The normalized adj matrix.
- Return type:
np.ndarray
- diffusion_adj(adj, transport_rate=0.2)[source]
Graph diffusion.
- Parameters:
adj (np.ndarray) – Input adj matrix.
transport_rate (float) – The transport rate.
- Returns:
The graph diffusion.
- Return type:
np.ndarray
pydgc.pipelines.dfcn_pipeline
- normalize(mx)[source]
Row-normalize sparse matrix.
- Parameters:
mx (scipy.sparse) – Input sparse matrix.
- Returns:
Row-normalized sparse matrix.
- Return type:
scipy.sparse
pydgc.pipelines.dgcluster_pipeline
pydgc.pipelines.gae_pipeline
pydgc.pipelines.gae_ssc_pipeline
pydgc.pipelines.hsan_pipeline
pydgc.pipelines.magi_batch_pipeline
- get_sim(batch, adj, wt=20, wl=3)[source]
Get similarity matrix.
- Parameters:
batch (torch.Tensor) – Batch indices.
adj (SparseTensor) – Adjacency matrix.
wt (int, optional) – Number of random walks. Defaults to 20.
wl (int, optional) – Length of random walks. Defaults to 3.
- Returns:
Similarity matrix.
- Return type:
torch.Tensor
pydgc.pipelines.magi_pipeline
- get_sim(batch, adj, wt=20, wl=3)[source]
Get similarity matrix.
- Parameters:
batch (torch.Tensor) – Batch indices.
adj (SparseTensor) – Adjacency matrix.
wt (int, optional) – Number of random walks. Defaults to 20.
wl (int, optional) – Length of random walks. Defaults to 3.
- Returns:
Similarity matrix.
- Return type:
torch.Tensor