Select from an Existing Method from Configuration
The DGRL-Hardware toolbox provides the implementation of 21 existing combinations of GNN, GT backbone, message passing direction and positional encoding (PE) incorporation. One can call one of these methods by editing the general configuration (listed in ./configs/general/) and the PE configuration (listed in ./configs/pe/.
An example of the genral config can be as follows:
# general_config.yaml
model:
name: BIGAT
hidden_dim: 192
num_layers: 3
node_input_dim: 7
edge_input_dim: 2
dropout: 0.2
mlp_out:
num_layer: 4
The name of all the implemented backbones are listed in the table below, for a detailed introduction on the interface and implementation of each base model, please refer to Introduction on base DGRL methods:
GNN backbone/transformer |
mesage passing |
name in config |
|---|---|---|
DGCN DiGCN MagNet GCN GCN GCN GIN(E) GIN(E) GIN(E) GAT GAT GAT GPS-T GPS-T GPS-T GPS-P GPS-P GPS-P |
directed directed directed undirected directed bidirected undirected directed bidirected undirected directed bidirected undirected directed bidirected undirected directed bidirected |
DGCN DiiGCN MSGNN GCN DIGCN BIGCN GIN(E) DIGIN(E) BIGIN(E) GAT DIGAT BIGAT GPS DIGPS BIGPS PERFORMER DIPERFORMER BIPERFORMER |
An example to configure PE is shown as follows:
# pe_config.yaml
model:
pe_file_name: maglap_1q_spe
pe_type: maglap
q: 0.1
q_dim: 1
pe_strategy: invariant_fixed
pe_encoder: spe
mag_pe_dim_input: 10
mag_pe_dim_output: 10
se_pe_dim_input: 0
se_pe_dim_output: 0
eigval_encoder:
in: 1
hidden: 32
out: 8
num_layer: 3
The table below show the configuration to use for magnetic Laplacian PE with NPE or EPE:
stable |
potential q |
pe_type |
pe_strategy |
pe_embedder |
example |
|---|---|---|---|---|---|
NPE NPE EPE EPE |
q=0 q>0 q=0 q>0 |
lap maglap lap maglap |
variant variant invariant_fixed invariant_fixed |
naive naive |
./configs/pe/lap10/lap_naive ./configs/pe/maglap10/maglap_1q_naive ./configs/pe/lap10/lap_spe ./configs/pe/maglap10/maglap_1q_spe |
The eigval_encoder is used to configure the hyper-parameters of stable PE.