bohu615 / nu_gan Goto Github PK
View Code? Open in Web Editor NEWunsupervised cell-level visual representation learning
unsupervised cell-level visual representation learning
Hello,
I've been trying to reproduce the results of cell-level clustering from the paper.
According to Table II, for dataset A, your method achieved purity = 0.855
, entropy = 0.750
and f-score = 0.863
.
I have run your code with different configurations, but for some reason, I can't achieve the same results as those reported in the paper.
According to the paper, the model was trained with n_epoch = 10
, batchsize = 64
, lr = 2e-4
purity = 0.511
, entropy = 1.548
and f_score = 0.589
Using the defaults of the code: n_epoch = 50
, batchsize = 10
, lr = 1e-4
purity = 0.725
, entropy = 1.137
and f_score = 0.732
I also ran the code with other configurations to investigate:
n_epoch = 10
, batchsize = 64
, lr = 1e-4
purity = 0.535
, entropy = 1.451
, f_score = 0.617
n_epoch = 50
, batchsize = 64
, lr = 1e-4
purity = 0.668
, entropy = 1.087
, f_score = 0.689
n_epoch = 50
, batchsize = 10
, lr = 2e-4
purity = 0.725
, entropy = 1.145
, f_score = 0.733
It seems that for all the runs, my results are significantly lower than the results you got. Could you please provide me some guidance on what could be causing this discrepancy? Any thoughts would be highly appreciated!
Thank you,
Nathalia
Hi,
I have been trying to use your code, I encountered a lot of errors. I could able to solve some errors for task cell segmentation, image classification. The solutions are:
#line 309, 310
#add
#width_ = int(width/2)
#height_ = int(height/2)
#exrperiment.py
#line 5,6
#add
#from utils.segmentation_functions
#from utils.gan_model
With above you could run two tasks; cell segmentation and image classification.
#gan_model
#line 233, 241, linear
#weight_values = weight_values.permute(1, 0)
#line 741
#one = torch.tensor(1, dtype = torch.float)
#line 792
But when I'm stuck on cell representation, I'm not able to solve those errors, could you please help on this. Codes are outdated and need to be updated. The error I'm stuck on is this:
folder_name:1620389608
Traceback (most recent call last):
File "/content/nu_gan/nu_gan.py", line 57, in
ld, lg, lq, save_model_steps)
File "/content/nu_gan/utils/experiment.py", line 78, in cell_representation
dis_category=dis_category, ld=ld, lg=lg, lq=lq, save_model_steps=save_model_steps)
File "/content/nu_gan/utils/gan_model.py", line 788, in train_representation
fake = Variable(netG(noisev).data)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/nu_gan/utils/gan_model.py", line 148, in forward
x = self.layer_up_1(x)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/content/nu_gan/utils/gan_model.py", line 78, in forward
shortcut = self.upsample(shortcut) #upsampleconv
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/upsampling.py", line 141, in forward
return F.interpolate(input, self.size, self.scale_factor, self.mode, self.align_corners)
File "/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py", line 3469, in interpolate
raise ValueError("only one of size or scale_factor should be defined")
ValueError: only one of size or scale_factor should be defined
Hi,
I want to reproduce your excellent work on my computer. When I run the nu_gan.py with --task cell_representation, I got the following errors:
Traceback (most recent call last):
File "/home/nu_gan/nu_gan.py", line 64, in
ld, lg, lq, save_model_steps)
File "/home/nu_gan/utils/experiment.py", line 78, in cell_representation
dis_category=dis_category, ld=ld, lg=lg, lq=lq, save_model_steps=save_model_steps)
File "/home/nu_gan/utils/gan_model.py", line 776, in train_representation
errD_real.backward(mone)
File "/home/anaconda2/lib/python2.7/site-packages/torch/tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/anaconda2/lib/python2.7/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: invalid gradient at index 0 - expected shape [] but got [1]
INFO:root:Using python for large_image caching
I review the code and guess maybe it is because of the definition of mone and I tried these format:
mone = torch.Tensor([-1.0])
or
mone = torch.FloatTensor([-1.0])
Both of them don't work.
Would you like give me some clues to solve the problem? Thank you.
Hello,
Thank you for making this code available!
There's a mismatch between the Datasets described in the paper and the data provided on this page.
From the paper description:
Data provided here:
dataset_A folders:
dataset_B folders:
In summary, the original images from all datasets in the paper were provided. However, only the cell-level images and labels for Dataset A are available. Would it be possible to provide those for the other datasets as well?
Thank you
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.