Coder Social home page Coder Social logo

dac's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dac's Issues

Error in layer Adaptive

i get this error when i call cifar100.py:


Preallocating 3658/12194 Mb (0.300000) on cuda0
Mapped name None to device cuda0: TITAN Xp (0000:01:00.0)
Traceback (most recent call last):
File "cifar100.py", line 150, in
z = Adaptive(norm = 2)(y)
File "cifar100.py", line 63, in init
super(Adaptive, self).init(**kwargs)
File "/home/cleber/anaconda3/envs/py36/lib/python3.6/site-packages/keras/engine/topology.py", line 313, in init
assert kwarg in allowed_kwargs, 'Keyword argument not understood: ' + kwarg
AssertionError: Keyword argument not understood: norm

I think that the super class 'Layer' doenst have the parameter norm, find in call of layer Adaptive:
z = Adaptive(norm = 2)(y)

why you call the constructor of Adaptive w/ this parameter if it does not exist?

Request for the rest of the code

You use a loss, binary_crossentropy on aux_output, which was not discussed in the paper. And the accuracy reported in the log is different to the reported results in the paper. Please could you upload the code that actually generated the reported results, for ImageNet and STL10, and in particular clarify if you used the additional aux_output loss for these reported results.

ValueError: Error when checking target: expected main_output to have shape (20,) but got array with shape (32,)

I got this error while trying to implement DAC on cifar 100.

Traceback (most recent call last):
  File "/home/james/Desktop/DAC/CIFAR100/cifar100.py", line 205, in <module>
    loss = model.train_on_batch([X_batch_i],[Y_, Y_batch])
  File "/home/james/anaconda3/envs/DL37/lib/python3.7/site-packages/keras/engine/training.py", line 1211, in train_on_batch
    class_weight=class_weight)
  File "/home/james/anaconda3/envs/DL37/lib/python3.7/site-packages/keras/engine/training.py", line 789, in _standardize_user_data
    exception_prefix='target')
  File "/home/james/anaconda3/envs/DL37/lib/python3.7/site-packages/keras/engine/training_utils.py", line 138, in standardize_input_data
    str(data_shape))
ValueError: Error when checking target: expected main_output to have shape (20,) but got array with shape (32,)

Y_.shape() = (32,20), Y_batch.shape() = (32,32). Is there any solution for this case?
I'm using keras version is 1.1.2, and theano version is 1.0.5 (couldn't run on 0.8.2). Due to some TypeErrors with Keras layers, I also modified the file a bit. I have attached the file I'm using here
cifar100.py.tar.gz

Error in running the code.

Hi I have tried running your mnist.py code and I cam across several discrepancies.

  • I had to use dim_ordering='th' in the first Convolution2D().

  • I have the following error after making the above change. I have added the screen-shot of the error. The line which causes this error is 123 of "mnist.py".
    error_init

Please can you help me address these issues.

Thanks

Questions about the settings in your experiments

Thank you for updating codes.

I have a question.
The settings in your codes are not equal to those in your paper. (e.g. batch size in your paper is 32 while that in your MNIST codes is 128, network architectures, the threshold for deciding target labels, the loss function in your paper is binary cross entropy while that in your code is mean squared error)
Which settings did you use in your experiments?

Thank you.

requirement for module version

Hello, I have been running your code recently, but there are some bugs all the time, I think maybe it is something wrong about the module version I've downloaded. I would like to ask if there are specific module version requirements for this code, if so. Thank you.

Max ACC~= 0.7 in Cifar100 and Max ACC~= 0.39 in Cifar10

Hello vector,

i tested the code in cifar100 w/ 20 clusters and the max acc that i achieve was ~0.7 and in the cifar10 w/ 10 clusters was ~0.39. There is some part of the experiment that is not described in the code and in the paper.

I just ran the code like is in the github, and dont achieved the results showed in the paper.

How you set the first wheights? There is something related to this that you forgot?

I subtracted the means of the images in cifar10 and 100 and the results improved to this values, that are much better than before.

There is something more in data that i need to do?

Thanks

DAC dose not returns the same number of clusters as indicated by the user

Hi. Thanks a lot for your nice algorithm, first.
I have an issue with the code when I run DAC code here https://github.com/vector-1127/DAC/tree/master/IMAGENET10. I do normalize the images, but no matter what I do, the algorithm sometimes returns less number of clusters as indicated. Where the problem could it be ? is there something wrong with loss or the architecture of the backbone network?
Another question is. When I run DAC code for my own dataset, and I put the number of clusters for example to 30, the algorithms returns randomly different number of clusters every time. For instance, it returns 23 number of clusters instead of 30 number of clusters. Is it to be expected with DAC ?
I appreciate your help a lot.

About the Pytorch version

Hi, I wonder whether anyone have implemented this repo in Pytorch? I have tried it, but it seemed doesn't work……

Number of sub batches

if sign>1:

Was this supposed to be if sign>=1? It's a little misleading right now, it looks like you are expecting 2 loops...

Also was python's next() what you were looking for here? It seems you can avoid the loop altogether. Unless I misunderstood.

Ignorance of Labeled Training Samples Selection?

@vector-1127 i only find the section in cifar-10_2

def my_binary_crossentropy(y_true, y_pred):
            w1 = K.switch(y_true<lower,1,0)
            w2 = K.switch(y_true>upper,1,0)
            w = w1 + w2
            nb_selected = K.sum(w)
            y_true = K.switch(y_true>(upper+lower)/2,1,0)
            return K.sum(w*K.binary_crossentropy(y_true, y_pred), axis=-1)/nb_selected
model.compile(optimizer=RMSprop(0.001), 
              loss={'main_output':my_binary_crossentropy,'aux_output':'binary_crossentropy'}, 
              loss_weights={'main_output':1,'aux_output':1})
for i in range(X_train.shape[0]//nb):
                Xbatch = X_train[index[np.arange(i*nb,(i+1)*nb)]]
                Y = cluster_l2.predict(Xbatch)
                Y_l1 = cluster_l1.predict(Xbatch)
                Ybatch = np.dot(Y,Y.T)
                for k in range(nb_epoch):
                    np.random.shuffle(index_loc)
                    for j in range(Xbatch.shape[0]//batch_size):
                        address = index_loc[np.arange(j*batch_size,(j+1)*batch_size)]
                        X_batch = Xbatch[address]
                        Y_batch = Ybatch[address,:][:,address]
                        Y_batch_l1 = Y_l1[address]
                        sign = 0
                        for X_batch_i in datagen.flow(X_batch, batch_size=batch_size,shuffle=False):
                            loss = model.train_on_batch([X_batch_i],[Y_batch_l1, Y_batch])
                            sign += 1
                            if sign>1:
                                break

but in the other codes, i find it is replaced by

for i in range(X_train.shape[0]//nb):
                Xbatch = X_train[index[np.arange(i*nb,(i+1)*nb)]]
                Y = cluster_l2.predict(Xbatch)
                **Ybatch = (np.sign(np.dot(Y,Y.T)-th)+1)/2**
                for k in range(nb_epoch):
                    np.random.shuffle(index_loc)
                    for j in range(Xbatch.shape[0]//batch_size):
                        address = index_loc[np.arange(j*batch_size,(j+1)*batch_size)]
                        X_batch = Xbatch[address]
                        Y_batch = Ybatch[address,:][:,address]
                        Y_ = Y[address]
                        sign = 0
                        for X_batch_i in datagen.flow(X_batch, batch_size=batch_size,shuffle=False):
                            loss = model.train_on_batch([X_batch_i],[Y_, Y_batch])
                            sign += 1
                            if sign>1:
                                break
model.compile(optimizer=RMSprop(0.001), 
              loss={'main_output':'binary_crossentropy','aux_output':'binary_crossentropy'}, 
              loss_weights={'main_output':1,'aux_output':10})

is there a simpilification about Labeled Training Samples Selection? pairs of pics with similarities between upper and lower are seems used to calculate the loss.

Old Models

Hi,

Can I get the models / code for the ones you reported in the paper?

Thank You

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.