vector-1127 / dac Goto Github PK
View Code? Open in Web Editor NEWclustering
clustering
i get this error when i call cifar100.py:
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?
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.
I still wait for the complete code. And the paper is really good.
For ImageNet script. This will give misleading accuracy because the test data is not unseen.
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
What script you use to run DAC w/ the cifar10 dataset?
The mnist.py modified or the cifar100.py?
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".
Please can you help me address these issues.
Thanks
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.
still waiting for the code
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.
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
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.
Hi,
You use the 20 superclusters for CIFAR100, rather than the 100 finegrained ones.
My question is, are the other baselines for 20 clusters or 100 clusters? In table 2 under "CIFAR100". http://openaccess.thecvf.com/content_ICCV_2017/papers/Chang_Deep_Adaptive_Image_ICCV_2017_paper.pdf
Thanks.
Hi, I wonder whether anyone have implemented this repo in Pytorch? I have tried it, but it seemed doesn't work……
Line 237 in 2246b1d
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.
@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.
Hello.
I want to know your license of github project about DAC.
Thanks. 👍
Hi,
Can I get the models / code for the ones you reported in the paper?
Thank You
Hi,
I ran the cifar10_2.py code and get acc 21% after 50 epoch . For the data preprocessing I have used code mentioned in https://github.com/vector-1127/DAC/blob/master/Datasets_description/read_data.py. Am I missing anything ? can you please help to reproduce the result mentioned in the paper.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.