salesforce/PCL

Problem during the adaptation to graph data for PCL.

ha-lins opened this issue · 8 comments

Hi Junnan,

Thanks for your great work! Now I'd like to conduct the PCL experiments on graph classification task (i.e., TUDataset), which includes about 1-5k graph instances with two-classes labels. I modified the code based on GraphCL. However, the Acc@Proto is 0.0 and the eval results are unchangeable approximately. I printed this line and the accp = 0 and the proto_out & proto_target is as follows:

捕获

My hyperparameters are as follow:

    parser.add_argument('--num-cluster', default=[200], type=int,
                        help='number of clusters')
    parser.add_argument('--bs', dest='bs', type=int, default=128,
                        help='batch_size')
    queue size; number of negative keys (default: 128)

Could you help me locate the reason for this problem? Thanks in advance!

Hi, the first 20 epochs are warm-up epochs with only InfoNCE loss, that's probably why the acc@proto is 0.

Thanks for your reply. I've revised the --warmup-epoch to 1 and is there any other reason? Are the values of proto_out & proto_target reasonable? Thanks!

it seems that each sample has similar similarity with many prototypes? e.g., the first 3 items of 2nd row of proto_out has the same value -0.0294, maybe you want to check if the prototypes have collapsed?

Yes, could you pls tell me how to check if the prototypes have collapsed? I also printed the pos_proto_id & neg_proto_id & all_proto_id. Are these values reasonable?

image

it seems most of your embeddings have collapsed to a few prototypes? you can save the prototype vectors (maybe also embeddings) and check if they represent meaningful cluster centroids.

Yes, could you pls explain what the index means here? I think it is from the ImageFolderInstance here and is the class label of the image. Is such understanding right? I'm not very familiar with computer vision. Thanks!

The index can be considered as image_id

Thanks for your reply.
(1) I found there are not such graph_id in graph datasets. Can I replace the index with range(batch_size)? I wonder if the image_id is different in various batches. Thanks!

(2) Are the eval_dataset the same as the train_dataset except for the different augmentation? This setting is a bit confusing and why they are not different images?