Avoid using feature size or dimension to infer the feature type
Using the array size to check the feature type doesn't work when the size happens to be the same as another feature type (e.g. number of edges == number of nodes). To avoid such edge case, we shouldn't use feature size or dimension to infer the feature type. Possible solutions:
- Provide a feature type lookup table either in the config file or stored directly in the pyg files.
- Formulate the feature naming scheme. i.e. add a prefix (such as "track", "edge" and "node") to the feature names.
The following places (non-exhaustive) have the same problem:
- https://gitlab.cern.ch/gnn4itkteam/commonframework/-/blob/dev/gnn4itk_cf/utils/mapping_utils.py#L165-185
- https://gitlab.cern.ch/gnn4itkteam/commonframework/-/blob/dev/gnn4itk_cf/stages/edge_classifier/edge_classifier_stage.py#L464
- https://gitlab.cern.ch/gnn4itkteam/commonframework/-/blob/dev/gnn4itk_cf/utils/mapping_utils.py#L378 where the array size is used to check whether it belongs to an edge-like feature
- https://gitlab.cern.ch/gnn4itkteam/commonframework/-/blob/dev/gnn4itk_cf/utils/loading_utils.py#L147
- https://gitlab.cern.ch/gnn4itkteam/commonframework/-/blob/dev/gnn4itk_cf/utils/loading_utils.py#L197
- https://gitlab.cern.ch/gnn4itkteam/commonframework/-/blob/dev/gnn4itk_cf/stages/edge_classifier/edge_classifier_stage.py#L598-600
Edited by Jay Chan