wudongming97 / TopoMLP

[ICLR2024] TopoMLP: A Simple yet Strong Pipeline for Driving Topology Reasoning
Apache License 2.0
131 stars 11 forks source link

confusing logical flip operation on gt when computing topo loss #23

Closed Wolfybox closed 2 months ago

Wolfybox commented 2 months ago

Both in topo_ll_head and topo_lt_head, before feeding into focal loss, the gt_adj (i.e. target) went through an logical operation

1 - targets[0][xs_new][:, ys_new].view(-1).long()

to flip 1 to 0. This is confusing to me since 1 in gt_adj should represent connected which should be the target we expect rel_preds to follow.

wudongming97 commented 2 months ago

It is due to the Focal loss setting. Taking N classes for example, numbers 0,1,2,...,N-1 represent foreground, and number N represents background. In binary classification, 0 represents the foreground while 1 represents the background.

Wolfybox commented 2 months ago

It is due to the Focal loss setting. Taking N classes for example, numbers 0,1,2,...,N-1 represent foreground, and number N represents background. In binary classification, 0 represents the foreground while 1 represents the background.

got it. thanks for the explanation.