Skip to content

[Model]add HGOT#290

Open
zhuyanhuazhuyanhua wants to merge 7 commits intoBUPT-GAMMA:mainfrom
zhuyanhuazhuyanhua:main
Open

[Model]add HGOT#290
zhuyanhuazhuyanhua wants to merge 7 commits intoBUPT-GAMMA:mainfrom
zhuyanhuazhuyanhua:main

Conversation

@zhuyanhuazhuyanhua
Copy link
Copy Markdown

@zhuyanhuazhuyanhua zhuyanhuazhuyanhua commented Mar 4, 2026

HGOT[ICML2025]

How to run

  • Clone the Openhgnn-DGL

    python main.py -m HGOT -t node_classification -d imdb4MAGNN -g 0

    If you do not have gpu, set -gpu -1.

    the dataset imdb4MAGNN is supported.

Performance: Node classification

  • Device: CPU, Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz 2.59 GHz
  • Dataset: IMDB
Node classification Macro-F1 Micro-F1
MAGNN 58.65% 59.20%
paper 60.75% 60.98%
OpenHGNN 60.54% 60.70%

The perform of experiments are run in the setting of paper which uses SVM classification, so it is a little bit different from semi-supervised node classification. And directly running the model is using semi-supervised node classification trainerflow.

Dataset

  • We process the IMDB dataset given by MAGNN. It is saved as dgl.heterograph and can be loaded by dgl.load_graphs

Description

  • imdb4MAGNN

    • Number of nodes

      movie 4278
      director 2081
      actor 5257
    • Number of edges

      movie-director 4278
      movie-actor 12828
    • Types of metapaths: MDM, MAM, DMD, DMAMD, AMA, AMDMA. Please note that the M is movie, D is director, A is actor, and the edges above are all bidirectional.

[TODO]

TrainerFlow: Node classification trainer

  • Graph Preprocess & Feature Transformation
    • To handle the heterogeneity where nodes of different types possess features of varying dimensions (or exist in different feature spaces), HGOT first projects the raw features into a unified latent space.
    • Unified Dimension Projection: Type-specific linear transformation matrices are designed to map the original features of each node type into a shared vector space.
    • Formula: For the i-th node of type $\phi_i$,the projected feature $h_i$
      is calculated as:$h_i$ = $ W_{\phi_i}$ * $x_i$ + $ b_{\phi_i} $
  • Heterogeneous Semantic Information Aggregation
    • To capture the rich high-order semantic information within the heterogeneous graph, HGOT employs an attention mechanism to aggregate multiple meta-path based views into a comprehensive "central view".
    • Branch View Generation: The original heterogeneous graph is decomposed into several homogeneous subgraphs (i.e., branch views) based on different meta-paths.
    • Central View Construction:
      Node Level: An attention network is utilized to compute node embeddings under each meta-path, which are then fused via weighted summation to obtain the aggregated node representation $ Z_agg $
      Edge Level: The adjacency matrices generated by each meta-path undergo a logical OR operation to produce the aggregated adjacency matrix $ A_agg $, preserving all potential connectivity information.
    • Objective: The central view integrates semantic information from various branch views and serves as the target distribution in the optimal transport process.

Hyper-parameters specific to the model

You can modify the parameters in openhgnn/config.ini

Description

feats_drop_rate = 0.3 # feature drop rate to get the feature drop list
attn_vec_dim = 64 # the dimesions of vector in the Attention Layer 
feats_opt = 110 # the type of nodes that needs to get the new features
loss_lambda = 0.2 # the weighted coefficient to balance the two parts.
src_node_type = 2 # the type of nodes that has the raw attributes
dropout = 0.1 # the drop rate used in Drop some Attributes
num_heads = 8 # the num of heads used in muti-head attention mechanism
HIN = MAGNN # the type of model used in Combination with the HIN Model.

More

Contirbutor

Yanhua Zhu[GAMMA LAB]

If you have any questions,

Submit an issue or email to 2023210015@bupt.cn.

More

Contirbutor

Yanhua Zhu[GAMMA LAB]

If you have any questions,

Submit an issue or email to 2023210015@bupt.cn.

Description

Checklist

Please feel free to remove inapplicable items for your PR.

  • [Y] The PR title starts with [$CATEGORY] (such as [NN], [Model], [Doc], [Feature]])
  • [Y] Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented
  • To the best of my knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change
  • Related issue is referred in this PR
  • If the PR is for a new model/paper, I've updated the example index here.

Changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant