benedekrozemberczki / SimGNN

A PyTorch implementation of "SimGNN: A Neural Network Approach to Fast Graph Similarity Computation" (WSDM 2019).
GNU General Public License v3.0
759 stars 147 forks source link

Ground truth values #13

Closed UTpH closed 5 years ago

UTpH commented 5 years ago

Hi! So the paper defines the ground truth similarity score as np.exp(-normalized_ged) which you calculate as the target in simgnn.py. But in score() you call calculate_normalized_ged() of utils.py that does not take the exponent of GED. Why is that? Shouldn't calculate_normalized_ged() be soemthing like this:-

def calculate_normalized_ged(prediction, target):
    normalized_ged = data["ged"]/(0.5*(len(data["labels_1"])+len(data["labels_2"])))
    norm_ged = np.exp(-normalized_ged)
    return norm_ged
BehroozMansouri commented 5 years ago

That is somehow my question too. In the score, the prediction, is the transformed ged prediction. How can I get the original ged estimation?

Is this correct:

real_ged_prediction = (-np.log(prediction.data.item())(0.5 (len_label1 + len_label2)))