How hkuds/opengraph works
Project type and purpose
• This is a research‐oriented graph‐ML pipeline that supports both synthetic graph generation and downstream tasks (link prediction, node classification).
• It ingests multiple public graph datasets (cora, citeseer, amazon-book, etc.), generates embeddings, estimates instance counts, and runs training/evaluation for two core tasks.
File structure
• Top‐level directories:
• datasets: raw and preprocessed adjacency, feature, label, mask, and few‐shot matrices for multiple benchmarks
• graph_generation: code to create synthetic graphs/embeddings and utilities
• link_prediction, node_classification: two parallel pipelines for model training & evaluation
• Models: stores or documents trained model artifacts
• History: stores pretraining history snapshots
• Shared utilities under Exp_Utils and Utils subdirectories (emailer, timelogging)
• Configuration/parameter files: each pipeline has params.py
• Entrypoints: main.py in link_prediction and node_classification
README
• (Empty here): rely on file names, directory roles, and code patterns
a. Main components
• Data Store: “datasets” directory (raw graph inputs, few‐shot splits)
• Preprocessing Modules: graph_generation/make_adjs.py, instance_number_estimation, embedding_generation, human_item_generation, itemCollecting
• Synthetic Graph Repository: graph_generation/gen_results (stores generated adjacency, embeddings, interaction matrices)
• Training Pipelines:
– Link Prediction Pipeline: link_prediction/data_handler → link_prediction/model → link_prediction/main
– Node Classification Pipeline: node_classification/data_handler → node_classification/model → node_classification/main
• Model Artifacts Store: Models directory, History directory (pretraining states)
• Shared Utilities: TimeLogger, Emailer (for logging, notifications)
b. Relationships and interactions
• Data Store feeds Preprocessing Modules
• Preprocessing outputs both to Synthetic Graph Repository and intermediates back to Data Store
• Training Pipelines pull from both Data Store (real graphs) and Gen_Results (synthetic graphs)
• Training outputs models to Models and History
• Utilities wrap around all modules for logging and monitoring
c. Architectural patterns/design principles
• Modular pipeline: split into clear stages (ingest → preprocess → generate → train/evaluate)
• Separation of concerns: graph generation logic isolated from downstream task code
• Reusability: shared utils for logging/emailing; params files for configuration
• Data‐centric: file‐based data store for reproducibility, few‐shot splits, masks
d. Key technologies/frameworks
• Python scripts orchestrating experiments
• Pickle (.pkl) for data serialization
• Custom machine learning code (no deep integration with frameworks visible here)