Git Product home page Git Product logo

cpp's People

Contributors

leslietrue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cpp's Issues

custom data

hello is it possible to use my arbitrary data with this?

Nice work! A few clarifications to reproduce results on ImageNet

Hello @LeslieTrue, and very nice work! Congrats on the ICLR acceptance!

I am really interested in reproducing your results on ImageNet. To this end, I would like to ask 2 things:

1. Hyperparameters on the paper and script args

After trying to match the code to the paper and supp. (table 7), I end up with the following hyperparameters for ImageNet

 "hidden_dim": 2048, 
 "z_dim": 1024, 
 "n_clusters": 1000, 
 "epo": 20, 
 "bs": 1024, 
 "lr": 0.0001, 
 "lr_c": 0.0001, 
 "momo": 0.9, 
 "pigam": 0.05, 
 "wd1": 0.0001, 
 "wd2": 0.005, 
 "eps": 0.1,   #  used in MLCLoss
 "pieta": 0.12,  # sinkhon knop for imagenet
 "piiter": 5, 
 "seed": 42, 
 "warmup": 2000,  # is this correct? Is this what you mean by 1-2 epochs on imagenet I guess?

Could you please confirm and let me know if there is any other hyperparameter I need to specify that may not be in the paper? Saving the args you specified to get state-of-the-art results to a .json file would help.

2. Evaluation after training

During training the MLPs on top of CLIP, you have an intermediate evaluation, which, to my understanding, is based on the mini-batch. Thus, the provided script main_efficient.py does not have any evaluation to reproduce the NMI and ACC from the paper.

How do I do that? So far, my best guess is that I need to compute z, logits = model(x) for the whole dataset and store the results and afterward:

self_coeff = (logits @ logits.T).abs().unsqueeze(0)
Pi = sink_layer(self_coeff)[0]
Pi = Pi * Pi.shape[-1]
Pi = Pi[0]
Pi_np = Pi.detach().cpu().numpy()
acc_lst, nmi_lst, _, _, pred_lst = spectral_clustering_metrics(Pi_np, n_clusters, y_np)

Is this how you actually evaluated? I guess if the test set has $n$ samples, that means that we need to compute the eigenvalues of an $n \times n$ matrix, which, as far as I can recall, is of $O(n^3)$.

Your help would be highly appreciated and will help us report your method in other datasets!

Thanks in advance, and have a great day!

Nikolas

Number of Clusters Estimation

Hello,

Firstly, I'd like to express my gratitude for sharing this code and your dedication to the project. After going through your paper, my understanding was that the CPP algorithm estimates the number of clusters. However, in the optimalcluster.py file, it seems that the number of clusters is required as an input.

Have I misunderstood something, or is there a part of the implementation that is yet to be completed?

Thank you for your time and clarification.

congratulations!

I have been following your work since last August! Well done and congratulations!

"logits = z" in main_efficient.py

Thanks for your GREAT WORK!!

But it seems that when training ImageNet, the cluster head's output is never used. In main_efficient.py,

with autocast(enabled=True):
                z, logits = model(x)
                logits = z
                self_coeff = (logits @ logits.T).abs().unsqueeze(0)

Could you please offer some explanations? Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.