Skip to content

Commit

Permalink
general readout
Browse files Browse the repository at this point in the history
  • Loading branch information
levtelyatnikov committed May 11, 2024
1 parent 332edef commit cac20f4
Show file tree
Hide file tree
Showing 37 changed files with 4,076 additions and 2,372 deletions.
2 changes: 1 addition & 1 deletion configs/dataset/PROTEINS_TU.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ parameters:
monitor_metric: accuracy
task_level: graph
data_seed: 9
split_type: random #'k-fold' # either "k-fold" or "random" strategies
split_type: k-fold #'k-fold' # either "k-fold" or "random" strategies
k: 10 # for "k-fold" Cross-Validation
train_prop: 0.5 # for "random" strategy splitting

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
_target_: topobenchmarkx.transforms.data_transform.DataTransform
transform_type: 'lifting'
transform_name: "SimplicialCliqueLifting"
complex_dim: ${oc.select:dataset.parameters.max_dim_if_lifted,2}
complex_dim: ${oc.select:dataset.parameters.max_dim_if_lifted,3}
preserve_edge_attr: ${oc.select:dataset.parameters.preserve_edge_attr_if_lifted,False}
signed: True
signed: False
feature_lifting: projection
29 changes: 19 additions & 10 deletions configs/model/cell/can.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,35 @@ backbone:
in_channels_1: ${model.feature_encoder.out_channels}
out_channels: ${model.feature_encoder.out_channels}
dropout: 0.0
heads: 4 # For now we stuck to out_channels//heads
heads: 1 # For now we stuck to out_channels//heads, keep heads = 1
concat: True
skip_connection: True
n_layers: 4
n_layers: 1
att_lift: False

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CANWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.selected_dimensions}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.selected_dimensions}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${parameter_multiplication:${model.backbone.out_channels},${model.backbone.heads}}
out_channels: ${dataset.parameters.num_classes}
pooling_type: sum

backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CANWrapper
_partial_: true
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
27 changes: 18 additions & 9 deletions configs/model/cell/ccxn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,29 @@ backbone:
backbone_additional_params:
hidden_channels: ${model.feature_encoder.out_channels}

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CCXNWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone_additional_params.hidden_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}
pooling_type: sum

backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CCXNWrapper
_partial_: true
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
30 changes: 19 additions & 11 deletions configs/model/cell/cwn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,30 @@ backbone:
hid_channels: ${model.feature_encoder.out_channels}
n_layers: 1

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CWNWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}


readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone.hid_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}
pooling_type: sum

backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CWNWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
normalize_outuputs: False
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
30 changes: 21 additions & 9 deletions configs/model/cell/cwn_dcm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,39 @@ feature_encoder:
in_channels: ${infer_in_channels:${dataset}} #${dataset.parameters.num_features}
out_channels: 32
proj_dropout: 0.0
selected_dimensions:
- 0
- 1

backbone:
_target_: custom_models.cell.cwn_dcm.CWNDCM
in_channels: ${model.feature_encoder.out_channels}
n_layers: 1
dropout: 0.0

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CWNDCMWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.selected_dimensions}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.selected_dimensions}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone.in_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}
pooling_type: sum

backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.CWNDCMWrapper
_partial_: true
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
37 changes: 19 additions & 18 deletions configs/model/graph/gat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ _target_: topobenchmarkx.models.network_module.NetworkModule

feature_encoder:
_target_: topobenchmarkx.models.encoders.default_encoders.BaseFeatureEncoder
in_channels: ${infer_in_channels:${dataset}} #${dataset.parameters.num_features}
in_channels: ${infer_in_channels:${dataset}}
out_channels: 32

backbone:
Expand All @@ -16,29 +16,30 @@ backbone:
heads: 4
concat: true

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

# evaluator:
# _target_: topobenchmarkx.evaluators.evaluator.Evaluator
# metrics: [acc, rocauc]
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.GNNWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone.hidden_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}

# readout_workaround:
# _target_: topobenchmarkx.models.readout_workaround.ReadOutWorkaround
# backbone_outputs: ["x_0"]
pooling_type: sum


backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.GNNWrapper
_partial_: true
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
28 changes: 18 additions & 10 deletions configs/model/graph/gcn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,29 @@ backbone:
dropout: 0.0
act: relu

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.GNNWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone.hidden_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}
pooling_type: sum

backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.GNNWrapper
_partial_: true
out_channels: 64
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
35 changes: 18 additions & 17 deletions configs/model/graph/gin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,30 @@ backbone:
dropout: 0.0
act: relu

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

# evaluator:
# _target_: topobenchmarkx.evaluators.evaluator.Evaluator
# metrics: [acc, rocauc]
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.GNNWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: PropagateSignalDown # Use <None> in case readout is not needed
hidden_dim: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone.hidden_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}

# readout_workaround:
# _target_: topobenchmarkx.models.readout_workaround.ReadOutWorkaround
# backbone_outputs: ["x_0"]
pooling_type: sum


backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.GNNWrapper
_partial_: true
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
27 changes: 18 additions & 9 deletions configs/model/hypergraph/alldeepset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,29 @@ backbone:
_partial_: true
#num_features: ${model.backbone.hidden_channels}

loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}
backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.HypergraphWrapper
_partial_: true
out_channels: ${model.feature_encoder.out_channels}
num_cell_dimensions: ${infere_list_length:${model.feature_encoder.in_channels}}

readout:
_target_: topobenchmarkx.models.readouts.default_readouts.GNNBatchReadOut
_target_: topobenchmarkx.models.readouts.readout.AbstractReadOut
readout_name: None # Use <None> in case readout is not needed
hidden_dim: None
num_cell_dimensions: None

head_model:
_target_: topobenchmarkx.models.head_model.models.DefaultHead
task_level: ${dataset.parameters.task_level}
in_channels: ${model.backbone.hidden_channels}
in_channels: ${model.feature_encoder.out_channels}
out_channels: ${dataset.parameters.num_classes}
pooling_type: sum

backbone_wrapper:
_target_: topobenchmarkx.models.wrappers.default_wrapper.HypergraphWrapper
_partial_: true
loss:
_target_: topobenchmarkx.models.losses.loss.DefaultLoss
task: ${dataset.parameters.task}
loss_type: ${dataset.parameters.loss_type}

optimizer:
_target_: torch.optim.Adam
Expand Down
Loading

0 comments on commit cac20f4

Please sign in to comment.