AAAI2022_ContrastNet icon indicating copy to clipboard operation
AAAI2022_ContrastNet copied to clipboard

How to use my own data set to classify?

Open xiejen opened this issue 2 years ago • 6 comments

How to apply this code to classify using my own dataset? I can't see how the model is trained and saved.

xiejen avatar Apr 10 '24 15:04 xiejen

Thanks for your feedback. You need to first generate data augmentations using code in the "paraphrase" folder. Then you can generate training, validation and test dataset using code in the "utils" folder.

AlbertChen1991 avatar Apr 11 '24 02:04 AlbertChen1991

Thank you so much. There is no code like the following in the project, so it is hard for me to figure out after saving the trained model, how to do the prediction. I can't figure out how to load the input tensor and how to call the model to do the prediction. Please help. thanks. y_pred = model(x)

xiejen avatar Apr 12 '24 15:04 xiejen

Does this mean to predict the label, it will need both the input test data and the support data? y_pred = self.pred_proto(z_query, z_support_proto) y_pred1 = self.pred_KNN(z_query, z_support, support_inds.reshape(-1), k=1) Is it possible to save the trained model and use y_pred = model(x)? Thinking in its application after the model is trained, it won't be practical to require the support data when used for prediction.

xiejen avatar Apr 15 '24 16:04 xiejen

You can't predict using y_pred = model(x) because this model is applied in meta-learning. That means you must prepare a support set for prediction.

AlbertChen1991 avatar Apr 16 '24 02:04 AlbertChen1991

How to apply this code to classify using my own dataset? I can't see how the model is trained and saved.

Hello, do you have the code for contrastNet? Could you share it with me?

happynewsday avatar Jul 07 '24 12:07 happynewsday

How to apply this code to classify using my own dataset? I can't see how the model is trained and saved.

Hello, do you have the code for contrastNet? Could you share it with me?

Please see the "master" branch.

AlbertChen1991 avatar Jul 10 '24 08:07 AlbertChen1991