Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug of Normalisation #10

Open
Linnore opened this issue Jul 3, 2024 · 1 comment
Open

Bug of Normalisation #10

Linnore opened this issue Jul 3, 2024 · 1 comment

Comments

@Linnore
Copy link

Linnore commented Jul 3, 2024

Multi-GNN/data_loading.py

Lines 108 to 127 in 252b025

#Adding ports and time-deltas if applicable
if args.ports:
logging.info(f"Start: adding ports")
tr_data.add_ports()
val_data.add_ports()
te_data.add_ports()
logging.info(f"Done: adding ports")
if args.tds:
logging.info(f"Start: adding time-deltas")
tr_data.add_time_deltas()
val_data.add_time_deltas()
te_data.add_time_deltas()
logging.info(f"Done: adding time-deltas")
#Normalize data
tr_data.x = val_data.x = te_data.x = z_norm(tr_data.x)
if not args.model == 'rgcn':
tr_data.edge_attr, val_data.edge_attr, te_data.edge_attr = z_norm(tr_data.edge_attr), z_norm(val_data.edge_attr), z_norm(te_data.edge_attr)
else:
tr_data.edge_attr[:, :-1], val_data.edge_attr[:, :-1], te_data.edge_attr[:, :-1] = z_norm(tr_data.edge_attr[:, :-1]), z_norm(val_data.edge_attr[:, :-1]), z_norm(te_data.edge_attr[:, :-1])

The data normalisation in line 127 does not normalise the last edge attribute, which corresponds to "payment format" . This is a desired behaviour if no ports nor time deltas are added. However, when ports or time deltas are added, the last edge attribute would not be "payment format" anymore and required normalisation.

@AlessioBoetti
Copy link

Agree. I'd like to add to this that when using Reverse MP, inside the create_hetero_obj function the edge_attr relative to the ports are swapped for the reverse edge, but this doesn't take into account the use of timedeltas, which if used together with the ports add other two columns, so the latest two columns are no more relative to the ports but relative to the timedeltas.

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

No branches or pull requests

2 participants